lingy

lread 2023-07-18T13:37:47.024769Z

@lee has joined the channel

borkdude 2023-07-18T13:45:31.413259Z

@borkdude has joined the channel

borkdude 2023-07-18T13:53:26.094639Z

👋

Ingy döt Net 2023-07-18T13:55:40.399399Z

Hi @borkdude

Ingy döt Net 2023-07-18T13:56:43.012539Z

borkdude 2023-07-18T13:57:00.769499Z

vars are important for development and REPL

Ingy döt Net 2023-07-18T13:57:07.667129Z

I remember @pez saying this the other day

borkdude 2023-07-18T13:57:24.884879Z

as in, you can reload one function and all other functions that use it, will see the new definition, without reloading them

Ingy döt Net 2023-07-18T13:57:41.057729Z

Makes sense

borkdude 2023-07-18T13:58:15.313239Z

but depending on your host, you might not have to reify them. E.g. ClojureScript just uses the fact that JavaScript already works this way

borkdude 2023-07-18T13:58:33.431569Z

don't know about Perl's semantics here

Ingy döt Net 2023-07-18T14:00:32.771289Z

The background on this is that Lingy doesn't currently have var support . Namespaces map symbols directly to values. This is mostly because Lingy descended from my https://github.com/kanaka/mal implementation and Mal skips vars for simplicity. It's been high on my list to resolve this (npi) but I was also trying to get as much done before last weeks conf and lack of vars wasn't a bottleneck at all.

borkdude 2023-07-18T14:02:39.855889Z

let me put it like this: In JavaScript, given that you have defined function window.f and then window.g , and window.g calls window.f, If you re-define window.f, the function window.g will pick up on that re-definition of window.f If Perl behaves that way you might not need vars. ClojureScript doesn't have vars for this reason. Note that a var indirection can also affect performance.

Ingy döt Net 2023-07-18T14:08:51.062279Z

interesting that cljs doesn't have vars. I have done much with cljs yet. I do want to try to get concurrency stuffs into Lingy so I imagine vars would be essential then. And yeah, adding a var layer of indirection would hit performance.

Ingy döt Net 2023-07-18T14:09:36.905779Z

Makes me wonder if there could be a dynamic var (or some setting) to turn var support on and off

borkdude 2023-07-18T14:09:39.937829Z

how are vars relevant to concurrency?

Ingy döt Net 2023-07-18T14:09:57.591159Z

not sure. I thought they were

borkdude 2023-07-18T14:10:01.410559Z

(I am not saying they are not, just trying to understand your thinking)

Ingy döt Net 2023-07-18T14:10:50.208099Z

well I've read about thread bindings and root bindings for vars

borkdude 2023-07-18T14:11:14.460169Z

well, dynamic vars are a special kind of vars that can carry a thread-local binding. So each thread can see their own value of a var and they are not mutated globally, only within a thread. But this relies on something specific in the JVM, called ThreadLocal. Not sure if Perl supports something like this

Ingy döt Net 2023-07-18T14:11:37.873619Z

ah gtk

borkdude 2023-07-18T14:12:00.552059Z

ClojureScript only has dynamic vars to mimic the JVM behavior, but tbh I think dynamic vars are usually an anti-pattern and it's better to pass stuff around via arguments

Ingy döt Net 2023-07-18T14:12:27.558699Z

yeah they seem like weirdos 🙂

Ingy döt Net 2023-07-18T14:14:29.046779Z

This is good to know that I can keep vars on the back burner for now. Until I have a real need. I was a bit worried that people wouldn't take Lingy seriously if it didn't support vars

borkdude 2023-07-18T14:18:45.219679Z

As long as your REPL supports reloading in the way I mentioned it before, it should be good

borkdude 2023-07-18T14:19:34.265709Z

Another purpose of vars is that they can carry metadata (docstrings, etc) but perhaps this can be implemented in a different way

Ingy döt Net 2023-07-18T14:21:36.181809Z

Ah right. I did notice that vars were the place to store those values. And I do already store them in a different way.

Ingy döt Net 2023-07-18T14:24:13.802829Z

Basically Lingy has a global metadata map that keys on a values memory address

borkdude 2023-07-18T14:24:50.522319Z

"memory address"? this sounds scary, I thought Perl was a high level language :)

Ingy döt Net 2023-07-18T14:29:17.431149Z

Also inherited from https://github.com/kanaka/mal

Ingy döt Net 2023-07-18T14:29:23.052009Z

$ perl -E 'say {}'
HASH(0x55bab5f535b8)

Ingy döt Net 2023-07-18T14:29:57.390739Z

Is all I meant by memory address

borkdude 2023-07-18T14:29:58.922159Z

ok, you just mean the object reference, I guess?

borkdude 2023-07-18T14:30:11.213119Z

you compare by identity

borkdude 2023-07-18T14:30:34.685979Z

in Clojure: (identical? (Object.) (Object.)) ;;=> false

borkdude 2023-07-18T14:31:20.785159Z

never mind, I think I just misunderstood ;)

Ingy döt Net 2023-07-18T14:44:33.926609Z

$ lingy -C
Lingy 0.1.17 [perl]

*** Started Clojure REPL server (148375)

user=> (= (String. "") (String. ""))
true
Clojure:
true

user=> (identical? (String. "") (String. ""))
Unable to resolve symbol: 'identical?' in this context
Clojure:
false

user=> 

borkdude 2023-07-18T14:45:59.668719Z

= compares by value, identical? compares by identity

Ingy döt Net 2023-07-18T14:46:00.707019Z

I don't yet have identical? apparently. Adding to the list... And I don't have a lingy.lang.Object

Ingy döt Net 2023-07-18T14:46:33.917659Z

right. I was mostly just showing off lingy -C

Ingy döt Net 2023-07-18T14:46:55.757939Z

and that I still need to add identical?

borkdude 2023-07-18T14:47:01.287029Z

👍

Ingy döt Net 2023-07-18T14:48:05.865419Z

I also uncovered a bug with running 2 lingy repls at once.

Ingy döt Net 2023-07-18T14:49:24.984269Z

will make Lingy issues here and continue converting all my Lingy todo lists into issues as well.

Ingy döt Net 2023-07-18T14:49:35.028349Z

will make Lingy issues here and continue converting all my Lingy todo lists into issues as well.

Ingy döt Net 2023-07-18T14:50:09.638519Z

@borkdude nice to have you here. What's Clojure OSS?

borkdude 2023-07-18T14:50:20.326399Z

Btw, is "döt Net" a play on .net domain name, or is this your real name? :)

Ingy döt Net 2023-07-18T14:52:15.625599Z

both 🙂

borkdude 2023-07-18T14:52:39.121649Z

which language is this, Finnish?

Ingy döt Net 2023-07-18T16:42:14.892789Z

Internetian 😉

Ingy döt Net 2023-07-18T16:43:04.292359Z

dot Net is my legal surname due to united states 😕

Ingy döt Net 2023-07-18T16:44:33.507279Z

actually that's not correct either. the usa has no concept of name parts. just 1 string of certain characters

Ingy döt Net 2023-07-18T16:45:02.771949Z

legally I think it is INGY DOT NET in the court records

borkdude 2023-07-18T14:50:25.081329Z

OSS = Open Source Software

Ingy döt Net 2023-07-18T14:53:41.210189Z

of course. I was looking at your profile and thought maybe it meant something different in "Clojure OSS"...

borkdude 2023-07-18T14:54:03.102539Z

I'm from the Clojure land of OSS

Ingy döt Net 2023-07-18T14:54:22.440129Z

But you just meant in general writing OSS in Clojure 🙂

👍 1
Ben Sless 2023-07-18T14:54:23.780769Z

@ben.sless has joined the channel

Ingy döt Net 2023-07-18T14:54:34.155499Z

hi @ben.sless o/

Ben Sless 2023-07-18T14:57:42.532209Z

Hi Ingy!

Ingy döt Net 2023-07-18T14:57:50.054749Z

@borkdude @pez was telling me about Babashka. I'm super into Bash as a programming language and do stuff under here https://github.com/bpan-org

Ingy döt Net 2023-07-18T14:58:18.105279Z

we can chat about that another time

borkdude 2023-07-18T14:58:49.160519Z

I'm not super into bash, this is why I created bb ;) I'm also not super into yaml, this is why I prefer to convert back and forth to EDN if I can ;)

Ingy döt Net 2023-07-18T14:59:16.205469Z

I have no problem with that

borkdude 2023-07-18T14:59:31.672469Z

pretty impressive though!

borkdude 2023-07-18T15:00:19.240049Z

Someone made a Clojure implementation in bash once: https://github.com/alandipert/gherkin

borkdude 2023-07-18T15:00:43.871959Z

well, not Clojure, but inspired by

Ingy döt Net 2023-07-18T15:01:21.750679Z

I did see Bash in a clojure platform list once or twice. and thought that was nuts

Ingy döt Net 2023-07-18T15:01:57.146859Z

I don't even think I could write a yaml parser in pure bash

borkdude 2023-07-18T15:02:27.853739Z

Please don't join #clj-yaml, if you do, I apologize ;)

Ingy döt Net 2023-07-18T15:02:28.845319Z

Well I probably could because you know, if it was a challenge

Ingy döt Net 2023-07-18T15:02:42.040749Z

lol

Ingy döt Net 2023-07-18T15:03:09.789809Z

ok, they can join #yamlscript 😉

Ingy döt Net 2023-07-18T15:06:00.155919Z

The snakeyaml author used to participate in the YAML community forum https://matrix.to/#/#chat:yaml.io

Ingy döt Net 2023-07-18T15:06:41.207139Z

Not sure if he's in here.

Ingy döt Net 2023-07-18T15:07:13.208239Z

We kind of had a communication breakdown and he left (or stopped communicating)

borkdude 2023-07-18T15:07:54.001759Z

He is not here, but we have interacted with him. He is doing a steady job maintaining SnakeYAML. If you want to interact with him, this usually happens through the issue tracker on bitbucket of that project

Ingy döt Net 2023-07-18T15:10:09.977729Z

https://matrix.yaml.info/ snake scores poorly there but there's a lot of edge cases in the test suite so not really that critical to using it reliably

Ingy döt Net 2023-07-18T15:11:06.251299Z

mostly due to him porting from libyaml which scores rather poorly

Ingy döt Net 2023-07-18T15:11:20.386449Z

but is a bedrock yaml parser

borkdude 2023-07-18T15:11:31.531829Z

In the Clojure community we care mostly about things being stable and predictable. clj-yaml wraps the 1.1 parser which is also available in #babashka

borkdude 2023-07-18T15:12:52.567849Z

One issue with the 1.2 spec is that it breaks 1.1 compatibility, so you cannot even parse 1.1 documents reliably with a 1.2 parser

borkdude 2023-07-18T15:13:12.224929Z

Glad to be proven wrong by you as an expert though

Ingy döt Net 2023-07-18T15:14:04.415979Z

I wrote the first yaml parser (https://github.com/yaml/yaml-reference-parser) that passed all the test suite.

Ingy döt Net 2023-07-18T15:14:44.867309Z

a couple years ago. but it's not usable yet performance-wise 😕

Ingy döt Net 2023-07-18T15:15:10.248619Z

it was more to fully vet the grammar productions in the spec

Ingy döt Net 2023-07-18T15:15:40.840409Z

https://github.com/pantoniou/libfyaml/ is the future and pantoniou is on our core team

Ingy döt Net 2023-07-18T15:16:18.787239Z

but not here to talk about yaml. (and yeah yaml is a mess in many ways)

Ingy döt Net 2023-07-18T15:16:49.524159Z

but feel free to ask me anything about it or anything I can help with

👍 1
adamfrey 2023-07-18T20:02:28.365319Z

@adamfrey has joined the channel

souenzzo 2023-07-18T20:18:28.034219Z

@souenzzo has joined the channel

pez 2023-07-18T22:10:03.685909Z

> I think dynamic vars are usually an anti-pattern and it’s better to pass stuff around via arguments Not gonna argue against this. They have their uses, but they easily can help you create a mess. However, I want to note that for the purpose of implementing the REPL some “standard” dynamic vars should be handled correctly. I don’t know enough to enumerate which ones, but things will get weird if *ns*, *1 (and 2 and 3), *e are not kept separately bound for separate clients/sessions. nREPL sessions comes to mind.

Ingy döt Net 2023-07-18T22:23:14.362059Z

makes sense

Caio Cascaes 2023-07-18T22:31:54.740909Z

@caio.cascaes has joined the channel

2023-07-18T23:11:17.911469Z

@phill has joined the channel

2023-07-18T23:14:47.296519Z

I have never heard of yaml and I intend to remain ignorant of it but wowee zowee what a wondrous challenge you found in Lingy!!

2023-07-18T23:15:37.454689Z

Lingy will close the final obstacle to a fully-Perl open source mobile phone.

2023-07-18T23:17:13.967359Z

Dart and Swift are, you know, experimental. Perl is something you can run on a rotary phone from the 1960s. This is the ideal stable environment for Clojure programs.

2023-07-18T23:18:28.743489Z

Access to use all of CPAN is something not even the original Clojure has.

2023-07-18T23:20:26.124969Z

Er - to get down to nuts and bolts - is this "Perl 6" nowadays, or is Lingy's Perl the Perl-5 kind of Perl?

pez 2023-07-19T00:26:43.686829Z

It’s Perl-5 so far. But the goal is to support target many languages, so Perl 6 should probably become one of them. Is Perl 6 a thing, btw?

👍 1
hifumi123 2023-07-19T08:34:01.310949Z

Perl 6 is a thing but the changes from Perl 5 are so big that they gave it a new name “Raku”.

🙏 1
pez 2023-07-19T08:39:53.849669Z

A few minutes after I had asked that question it was answered in one of the videos from that Perl/Raku conference I was watching. 😀