267 points by mrcjkb 1 week ago | 134 comments
nerflad 1 week ago
jmercouris 1 week ago
0x3444ac53 1 week ago
creata 1 week ago
Fennel is more popular than I expected! It's in the official repositories of Arch, Fedora and Debian.
cmdrk 1 week ago
0x3444ac53 1 week ago
It's a great great language, and fixes a LOT of the issues I have with Lua.
Barrin92 1 week ago
On a lot of bases. Javascript has real lambdas, a sort of homoiconicity of code and data (hence JSON as a data format), also has the same dynamic take as lisps on "types belong to data". Rather than variables types belong to values. Brendan Eich's original idea was literally to "put scheme in the browser" and you can in fact pretty easily convert the Little Schemer to JS.
Saying two languages don't have much in common because they don't have the same syntax is a bit like saying we don't have much in common because we don't have the same hair color.
alex-robbins 1 week ago
I get that "sort of" was an attempt to hedge, but really, this isn't even close. Homoiconicity here would be if all javascript source files were valid JSON documents. A weaker version would be if it were common to use JSON to represent an arbitrary javascript program, but I've never heard of that, either. (For a good explanation of this weaker sense of homoiconicity, this stackoverflow page [1] is pretty good.)
[1]: https://stackoverflow.com/questions/31733766/in-what-sense-a...
To use Clojure as an example of a language that is homoiconic, you can take any Clojure source file, send it to an EDN parser (EDN being Clojure's equivalent of JSON), and not only will parsing succeed, but the result will be a complete representation of the program (you could execute it if you wanted to). In contrast, if you try to send JS to a JSON parser, you'll get an error as soon as it hits a function definition, or a for loop, or an operator, or whatever.
kazinator 1 week ago
What they have is code parsed to a data structure, which is then susceptible to manipulation by the program before being executed. JS has some dumb textual eval, like the Bourne shell.
They also have the concept of a symbol.
And only one value that is false.
galaxyLogic 1 week ago
ES6 JS has nice syntax for calculating with lists:
let [car, ...cdr] = [1,2,3]
After the above 'car' has value 1
and 'cdr' has value [2,3].behnamoh 1 week ago
car, *cdr = [1, 2, 3, 4]
jolux 1 week ago
pabs3 1 week ago
tcfhgj 1 week ago
let [car, cdr @ ..] = [1,2,3];
nateglims 1 week ago
sundarurfriend 1 week ago
soapdog 1 week ago
johnisgood 1 week ago
johnisgood 1 week ago
HMR is limited to modules (almost or always UI components), and there is no native VM support (module boundaries, side effects, and global state complicates it further) for it, and there is no multi-version coexistence either, and it is absolutely not suitable for production.
To call "hot module replacement" hot loading is very generous, and quite an overstatement.
It is only very superficially similar to hot code swapping. It is a developer tool, not a foundation for live, fault-tolerant systems.
It is absurd to call hot module replacement (HMR) "hot reloading". It might sound fancier, but it is nowhere close to true hot code swapping.
Peak redefinition of terminology. Call it what it is: hot module replacement, at best.
braebo 1 week ago
gavmor 1 week ago
jjtech 1 week ago
mrcjkb 1 week ago
MyOutfitIsVague 1 week ago
I don't know if this is better for that use case, but even if not, luarocks is clunky and annoying to use at best.
shortrounddev2 1 week ago
giraffe_lady 1 week ago
droelf 1 week ago
- pixi.sh (docs) - lua package on the registry: https://prefix.dev/channels/conda-forge/packages/lua
mrcjkb 1 week ago