Hacker News new | ask | show | jobs
by jstewartmobile 3127 days ago
So, Chicken Scheme[0] with a borrow checker?

[0] https://www.call-cc.org

1 comments

But without dynamic typing and Cheney on the MTA and with a completely different way of managing memory.

And not a scheme.

Scheme is a lisp, and I'm pretty confident that two of the biggest selling points of lisp are dynamic typing and a strong distaste for (if not an outright prohibition of) mutation.

Put it as a question because if you take those two things away, wouldn't it just be Rust with parenthesis?

The selling point of lisp is macros, and macros alone. Different dialects will have different characteristics: Common Lisp is dynamically typed and usually makes heavy use of mutation, others like Lux are purely functional and statically typed.

> wouldn't it just be Rust with parenthesis?

That's pretty much what it is.

> The selling point of lisp is macros, and macros alone.

That's a fairly bold claim.

Yes, but will macros retain their power in a statically typed environment?
They work pretty well in Crystal[1]. Some things are certainly a bit harder than they are in lisp/scheme but you can get a lot done with them. In crystal this is (in my experience) due to the lack of reflection support, and thus the ability to call dynamical looked up methods. Add that in and i'm pretty sure you'd remove >=90% of the current limitations, but even without that, you can get a lot done.

[1]: https://crystal-lang.org/

The only requirement to make macros work in a statically typed environment is to create a suitable type to represent the source code, and provide the operations to transform the said type. For instance, Rust has a macro system that's pretty nice to work with.

https://danielkeep.github.io/tlborm/book/README.html

They work OK in typed racket, but you will have to help the type checker a bit for the more complex macros.

And they provide utility that the type system doesn't. The for style loops are extremely useful