News for hackers. Stuff that matters.
Re:Learning Common Lisp to beat Java and Rust on a phone enc... by pjmlp on Saturday October 02, 2021 @02:55AM (#28726577)
It is similar to how many still don't belief in GC enabled systems languages.

If some big shot corporation with weight in the industry doesn't shove it down the throat of devs, then it isn't possible.

And regarding Lisp, most tutorials keep ignoring that arrays, structures, stack allocation, deterministic allocation,... are also part of Common Lisp.

Re:Learning Common Lisp to beat Java and Rust on a phone enc... by lmilcin on Saturday October 02, 2021 @07:49AM (#28727835)
> It is similar to how many still don't belief in GC enabled systems languages.

Well... don't give my application as an example.

I have worked around the GC problem by using CL as kind of compiler for the application -- I built high level DSL that was then compiled to binary supplemented with small blocks written in ANSI C.

If you think about it, SBCL already does this and so does JIT in JVM.

I will give you an example:

Before the order goes to the exchange, it needs to be validated against a set of rules. Like "do we have enough money to run this order?" or "How much of allotted limit this algorithm still has?" or "Is volatility on this market within bounds for this algorithm to be used?"

The rules were written in Common Lisp DSL, then Common Lisp code converted it to a decision tree, then optimized decision tree, then compiled optimized version of the decision tree to a binary function. That function itself had no longer anything to do with Common Lisp, it could have just as well been written in ANSI C.

Then Common Lisp code wired these functions to form the application.

While most of the application code was actually Common Lisp (and some 20% of ANSI C), if you were market order and observed what instructions are handling you, none of them would actually be Common Lisp.

After the initial setup, the Common Lisp application was running on only one core, and the constructed binary took over all over cores and was running without garbage collection on memory regions allocated outside of Common Lisp system.

I hope this description makes sense... I have never before or after met an application that was built this way. As far as I know it is only one of its kind.

Re:Learning Common Lisp to beat Java and Rust on a phone enc... by agumonkey on Saturday October 02, 2021 @09:48AM (#28728549)
You know, even beyond Common Lisp, lisp literature is often surprisingly low level. Lambda papers are dealing with assembly too. People may be confused about lisp being up high in its ivory towers but the people in this subculture were extremely diligent/smart on both end of the ladder.
Re:Learning Common Lisp to beat Java and Rust on a phone enc... by lmilcin on Saturday October 02, 2021 @10:45AM (#28728968)
Part of this is that when Lisps started ALL other languages were very low level and the hardware that the Lisps were running on did not afford to waste any memory or cycles.

So efficiency was an important consideration right from the start.

Other languages that most people use today grew at later times (borrowing from Lisp) when the resources wasn't such a big deal.

I consider languages like PHP, Ruby and Python peak examples of mainstream languages that were created with barely any consideration for efficiency. This coincides with 1990s and early 2000s where we saw dramatic increase of system resources and especially memory without much need to use it efficiently.

Nowadays it improved a little bit as we learn to run bigger loads so newer mainstream languages (like Rust) and some older (like Java, C# or JavaScript) are putting more effort on efficiency.

Re:Learning Common Lisp to beat Java and Rust on a phone enc... by pjmlp on Saturday October 02, 2021 @11:59AM (#28729626)
Indeed, when someone points out "you cannot do that because...", I feel the urge to point them out to what was happening on 1960's hardware and how much their watch outperforms a Connection Machine.
Re:Learning Common Lisp to beat Java and Rust on a phone enc... by agumonkey on Saturday October 02, 2021 @12:29PM (#28729897)
the memory capacity of society is astonishingly low
Re:Learning Common Lisp to beat Java and Rust on a phone enc... by agumonkey on Saturday October 02, 2021 @12:11PM (#28729715)
Christian Queinnec (Lisp in Small Pieces author) vaguely mentions that all dynamic languages are lisp under various clothings.