@lee has joined the channel
@borkdude has joined the channel
đ
Hi @borkdude
vars are important for development and REPL
I remember @pez saying this the other day
as in, you can reload one function and all other functions that use it, will see the new definition, without reloading them
Makes sense
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
don't know about Perl's semantics here
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.
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.
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.
Makes me wonder if there could be a dynamic var (or some setting) to turn var support on and off
how are vars relevant to concurrency?
not sure. I thought they were
(I am not saying they are not, just trying to understand your thinking)
well I've read about thread bindings and root bindings for vars
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
ah gtk
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
yeah they seem like weirdos đ
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
As long as your REPL supports reloading in the way I mentioned it before, it should be good
Another purpose of vars is that they can carry metadata (docstrings, etc) but perhaps this can be implemented in a different way
Ah right. I did notice that vars were the place to store those values. And I do already store them in a different way.
Basically Lingy has a global metadata map that keys on a values memory address
"memory address"? this sounds scary, I thought Perl was a high level language :)
Also inherited from https://github.com/kanaka/mal
$ perl -E 'say {}'
HASH(0x55bab5f535b8)Is all I meant by memory address
ok, you just mean the object reference, I guess?
you compare by identity
in Clojure: (identical? (Object.) (Object.)) ;;=> false
never mind, I think I just misunderstood ;)
$ 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=> = compares by value, identical? compares by identity
I don't yet have identical? apparently. Adding to the list...
And I don't have a lingy.lang.Object
right. I was mostly just showing off lingy -C
and that I still need to add identical?
đ
I also uncovered a bug with running 2 lingy repls at once.
will make Lingy issues here and continue converting all my Lingy todo lists into issues as well.
will make Lingy issues here and continue converting all my Lingy todo lists into issues as well.
@borkdude nice to have you here. What's Clojure OSS?
Btw, is "döt Net" a play on .net domain name, or is this your real name? :)
both đ
which language is this, Finnish?
Internetian đ
dot Net is my legal surname due to united states đ
actually that's not correct either. the usa has no concept of name parts. just 1 string of certain characters
legally I think it is INGY DOT NET in the court records
OSS = Open Source Software
of course. I was looking at your profile and thought maybe it meant something different in "Clojure OSS"...
I'm from the Clojure land of OSS
But you just meant in general writing OSS in Clojure đ
@ben.sless has joined the channel
hi @ben.sless o/
Hi Ingy!
@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
we can chat about that another time
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 ;)
I have no problem with that
pretty impressive though!
Someone made a Clojure implementation in bash once: https://github.com/alandipert/gherkin
well, not Clojure, but inspired by
I did see Bash in a clojure platform list once or twice. and thought that was nuts
I don't even think I could write a yaml parser in pure bash
Please don't join #clj-yaml, if you do, I apologize ;)
Well I probably could because you know, if it was a challenge
lol
ok, they can join #yamlscript đ
The snakeyaml author used to participate in the YAML community forum https://matrix.to/#/#chat:yaml.io
Not sure if he's in here.
We kind of had a communication breakdown and he left (or stopped communicating)
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
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
mostly due to him porting from libyaml which scores rather poorly
but is a bedrock yaml parser
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
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
Glad to be proven wrong by you as an expert though
I wrote the first yaml parser (https://github.com/yaml/yaml-reference-parser) that passed all the test suite.
a couple years ago. but it's not usable yet performance-wise đ
it was more to fully vet the grammar productions in the spec
https://github.com/pantoniou/libfyaml/ is the future and pantoniou is on our core team
but not here to talk about yaml. (and yeah yaml is a mess in many ways)
but feel free to ask me anything about it or anything I can help with
@adamfrey has joined the channel
@souenzzo has joined the channel
> 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.
makes sense
@caio.cascaes has joined the channel
@phill has joined the channel
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!!
Lingy will close the final obstacle to a fully-Perl open source mobile phone.
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.
Access to use all of CPAN is something not even the original Clojure has.
Er - to get down to nuts and bolts - is this "Perl 6" nowadays, or is Lingy's Perl the Perl-5 kind of Perl?
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?
Perl 6 is a thing but the changes from Perl 5 are so big that they gave it a new name âRakuâ.
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. đ