Carp, a compiled Lisp with type inference and a borrow checker
81–90 of 112 posts
Re: Carp, a compiled Lisp with type inference and a borrow checker
#82The borrow checker is the reason to use Rust, in spite of its annoyances (clunky syntax, limited type inference, non-interactive programming, long compilation times, etc.), so it's always nice to see someone trying to provide the upsides of Rust without the downsides. That being said, your website is disappointingly terse regarding how Carp recovers the advantages of Rust in the context of a Lisp derivative. What mak…
That still doesn't mean that it's a good idea to enable -XIncoherentInstances, though.
Re: Carp, a compiled Lisp with type inference and a borrow checker
#83Earlier quoted context omitted.
One of the good LISP's back in the day was PreScheme that let it finally be a C alternative efficiency-wise. It was also used in first, verified LISP. Such a style might also be good for bootstrapping or just making more flexible ways to code C. https://en.m.wikipedia.org/wiki/PreScheme Looking at PreScheme, Carp doing a C alternative safe without a GC is a nice evolution of these LISP's. Next cool possibility: use a…
> Next cool possibility: use a Rust-like LISP Why do you want a Rust with Lisp syntax? I don't see the benefits of such a "Lisp" if you take the core benefits of metaprogramming at runtime away which depends on the equality of code and data. Safe software can also be written in other languages than Rust. Ada is still industry standard of safe programming today. Even Lisp can be used to write safe software since Lisp'…
The phrase was ambiguous. I meant a LISP w/ safe, memory model like Carp. There's already LISP's in the past and present for OS's. There's also projects that restrict the power of languages to get better efficiency in low-level work. So, more of the latter with Rust's memory model might be advantageous. The former with their flexibility could be built on top of that same language with a low-latency GC for anything done dynamically or which the analyzer just couldn't handle enough to know safety. Might lead to a great performance boost on top of safety benefits.
"Safe software can also be written in other languages than Rust. Ada is still industry standard of safe programming today."
You're right that Ada was a language systematically designed for safety that people could be using right now. I gave them some resources on that here:
https://news.ycombinator.com/item?id=15771552
The problem: Ada does not have temporal safety or flexible support for race-free concurrency. The first part in Ada doesn't exist at all: they have to do unsafe deallocation when their tricks like memory pools aren't enough. The second, Ravenscar, is like a tome in its restrictions compared to the basic rules of the borrow-checker in Rust. Rust smashes Ada so hard on "safety without GC concept" that I told Yannick McCoy at AdaCore to get someone on achieving parity pronto. For SPARK if nothing else since it would have provably-safe sequential procedures whose composition was also safe w/ Rust's method. That would be awesome for projects such as IRONSIDES DNS.
"Rust shines in the field where Mozilla developed it for -- safe Internet browsers."
Rust shines anywhere you want safe, systems code without a GC and with concurrency. That's it's main selling point, not language design. There's tons of applications for that as the huge ecosystem is showing us replacing all sorts of components in other languages with safe, fast alternatives. Redox OS did an OS in it. In high-assurance sector, Robigalia was wrapping seL4 so one can have safe apps in Rust on a formally-verified, separation kernel. bluejekyll upthread wrote a DNS server (TrustDNS) in it. Rust can do about anything an analyzable subset of C can do.
"The Lisp version would just not be as performant as Ada's and Rust's."
This is correct. My recommendation to use one close to the metal like PreScheme with Rust-style safety that outputs C for LLVM attempts to address that. All the macros apply until the resulting code is straight-forward. The translation should be straight-forward to C where LLVM does the heavy lifting. One might also use techniques from projects such as Chicken Scheme, a whole-program optimizer, and/or a super-optimizer. The speed differences might be so minimal that nobody even cares. They already are for several LISP's on most applications but I'm talking system code.
Re: Carp, a compiled Lisp with type inference and a borrow checker
#84Re: Carp, a compiled Lisp with type inference and a borrow checker
#85So, Chicken Scheme[0] with a borrow checker? [0] https://www.call-cc.org
But without dynamic typing and Cheney on the MTA and with a completely different way of managing memory. And not a scheme.
Put it as a question because if you take those two things away, wouldn't it just be Rust with parenthesis?
Re: Carp, a compiled Lisp with type inference and a borrow checker
#86The borrow checker is the reason to use Rust, in spite of its annoyances (clunky syntax, limited type inference, non-interactive programming, long compilation times, etc.), so it's always nice to see someone trying to provide the upsides of Rust without the downsides. That being said, your website is disappointingly terse regarding how Carp recovers the advantages of Rust in the context of a Lisp derivative. What mak…
Common Lisp programmers use static typing for gaining speed, not for any kind of added "safety". For safety we have very good package isolation, really strict typing, typecasing, multimethods, conditions and restarts, and the friendly runtime overseeing the code execution like a god and helping the programmer as a good loyal friend would do.
Re: Carp, a compiled Lisp with type inference and a borrow checker
#87I've been waiting for a non-Clojure lisp to make some headway. Immutability is mostly a fad: look at how incredibly complicated Clojure's implementation is. It's not worth sacrificing elegance just to attract the true believers.
Common Lisp welcomes you, as awesome as ever since 1994.
>Immutability is mostly a fad
Inmutability is good. What i don't like is mandatory inmutability with no easy way to opt out.
Re: Carp, a compiled Lisp with type inference and a borrow checker
#88Nim https://nim-lang.org is programmable as well, more mature, and multiple memory management models are coming out.
Re: Carp, a compiled Lisp with type inference and a borrow checker
#89Earlier quoted context omitted.
> Next cool possibility: use a Rust-like LISP Why do you want a Rust with Lisp syntax? I don't see the benefits of such a "Lisp" if you take the core benefits of metaprogramming at runtime away which depends on the equality of code and data. Safe software can also be written in other languages than Rust. Ada is still industry standard of safe programming today. Even Lisp can be used to write safe software since Lisp'…
"Rust-like LISP" The phrase was ambiguous. I meant a LISP w/ safe, memory model like Carp. There's already LISP's in the past and present for OS's. There's also projects that restrict the power of languages to get better efficiency in low-level work. So, more of the latter with Rust's memory model might be advantageous. The former with their flexibility could be built on top of that same language with a low-latency G…
Wouldn't it be easier to develop a very basic OS core in Rust, and a simple Lisp 1.5 interpreter written in Rust as foundation for a full blown Lisp?
Re: Carp, a compiled Lisp with type inference and a borrow checker
#90The borrow checker is the reason to use Rust, in spite of its annoyances (clunky syntax, limited type inference, non-interactive programming, long compilation times, etc.), so it's always nice to see someone trying to provide the upsides of Rust without the downsides. That being said, your website is disappointingly terse regarding how Carp recovers the advantages of Rust in the context of a Lisp derivative. What mak…
> What makes this particularly suspicious is the fact that, in the past, Lisp programmers have claimed to recover the advantages of other statically typed languages in a Lisp setting, but there have always been huge caveats, like “the system can be very easily circumvented, reducing the benefits of static typing to nothing” Common Lisp programmers use static typing for gaining speed, not for any kind of added "safety…
These features exist for expressiveness, not safety reasons. Although it must be noted that these features make it hard to verify the correctness of programs in a modular fashion. Typecasing makes language-enforced abstraction essentially impossible.
> conditions and restarts
These features exist for debuggability, not safety reasons. Safety means ruling out delimited classes of “bad” behaviors by (language) design.
> friendly runtime overseeing the code execution
Now this is a safety feature, but it is only kind of incompatible with the zero-overhead needs of a low-level language.