Top
Best
New

Posted by surprisetalk 1 day ago

Loon: A functional lang with invisible types, safe ownership, and alg. effects(loonlang.com)
70 points | 38 commentspage 2
weitendorf 5 hours ago|
Very cool! I’ve been flirting with the idea of biting the bullet and moving more towards language extensions around protobuf/grpc vs just tools so it’s really great to see projects on the other side of that kind of decision shipping and what choices they made

Why the square brackets in particular? Notation is such an annoying part of this stuff, I’m actually leaning towards pushing a lot of structure to the filesystem

netbioserror 1 hour ago||
True beauty. Wow. My only ask would be optional type annotations for function and type parameters, so it's easy to fully describe your interfaces in code.
xigoi 4 hours ago||
Looks great! However, the website is really slow. Every page takes several seconds to load and trying to open the reference freezes my browser.
ethmarks 3 hours ago||
Apparently the site itself is written in Loon. The HTML is just a static shell that loads a `boot.js` script[1] that runs some WASM that compiles and evals the Loon source files. I found the source code here[2].

Definitely cool in concept, but very performance-intensive and slow.

[1]: https://loonlang.com/boot.js

[2]: https://github.com/ecto/loon/tree/main/web

mapcars 3 hours ago||
I'm assuming the website is written in Loon and according to roadmap its version 0.4 and compilation is planned in 0.7. So it demonstrates that the language works, but its not optimised yet.
ecto 3 hours ago||
exactly! I didn't post this (thank u whoever did though) so wasn't ready to launch yet. but the idea is it will SSR and hydrate each page. I want to pull it all out into a framework congruent to Next.js
kronnpp 3 hours ago||
How is it related to the Standard Meta Language (SML) family of languages?
IshKebab 3 hours ago|
It's such a lot of effort to make a language like this. I don't get why they don't just put in like 2% more effort and add syntax that makes it less awful for humans. Nobody really wants to write `[* 5 5]` do they?

  [fn square [x] [* x x]]
Could very easily be

  fn square(x) = x * x;
Or something like that, which is much more readable.

Also

> Hindley-Milner inference eliminates type annotations.

I think it's pretty widely agreed at this point that global type inference is a bad idea. The downsides outweigh the upsides. Specifically: much worse errors & much less readable code.

xigoi 1 hour ago||
> Nobody really wants to write `[* 5 5]` do they?

I do. The advantage being that if you suddenly realize that you want to do super-duper-multiplication instead of regular multiplication, you can just change the name instead of having to rewrite the entire expression. And honestly, having a few random functions be called differently from others feels gross.

mapcars 3 hours ago||
You never used lisp-like languages did you?
drob518 1 hour ago|||
There’s no use arguing. As the ancient Lisp proverb says, when the programmer is ready, the parens will disappear. Until then, you’re just wasting your breath.
IshKebab 2 hours ago|||
No because the syntax is so awful. Programming languages are consumed by machines but written by humans. You need to find a middle ground that works for both. That's (one of the reasons) why we don't all program in assembly any more.

Lisp and similar are just "hey it's really easy to write a parser if we just make all programmers write the AST directly!". Cool if the goal of your language is a really simple parser. Not so cool if you want to make it pleasant to read for humans.

TheFlyingFish 1 hour ago||
I've never used a Lisp either, but I get the impression that "forcing you to write the AST" is sort of the secret sauce. That is, if your source code is basically an AST to begin with, then transforming that AST programmatically (i.e. macros) is much more ergonomic. So you do, which means that Lisp ends up operating at a higher level of abstraction than most languages because you can basically create DSL on the fly for whatever you're doing.

That's my impression, at least. Like I said, I've never actually used a Lisp. Maybe I'm put off by the smug superiority of so many Lisp people who presume that using Lisp makes them better at programming, smarter, and probably morally superior to me.