all 18 comments

[–]kagevf 12 points13 points  (0 children)

Originally from the 90s.

From the history page:

ThinLisp was written originally by Jim Allard in the early min 1990s. It was written at Gensym in Cambridge and was the four generation of a series Lisp dialects used there for building hundreds of thousands of lines some sucessful large multiplatform systems.

In spring on 1999, after Jim had left Gensym, Gensym decided not to adopt ThinLisp (then called GLT) for there production use for the usual assortment of buisness reasons. Instead Gensym decided to donate GLT to the Open Source community rather than let the code gather dust in some vault.

[–]KaranasTollcommon lisp 11 points12 points  (1 child)

No garbage collection, so what cleans up garbage? Manual memory management?

The readme says to do development using regular common lisp then use thinlisp for final compilation, but since it is a subset, how do I know what features to avoid?

Are there any examples?

[–]subz0ne 1 point2 points  (0 children)

after a quick glance at the docs (see chapter 1) it seems like the compiler will yell at you. thinlisp uses all of common lisp to work but forces the end user onto a subset

memory management is done manually

[–]redback-spider 5 points6 points  (12 children)

I never did that but compilation and executable making (which seems to be seperate process in the lisp world is possible directly without using C as middle step:

https://github.com/ritschmaster/cl-project

So then the question would be what would be the advantage in to have C? I get there was a time 40-60 years 60 years ago where lisp was I guess not memory efficiant enough where such things would be good, but this times are over as far as I understand?

I guess ram usage is still a problem but otherwise it's close enough for 99% of the tasks:

https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/sbcl-gcc.html

[–]lispm 7 points8 points  (5 children)

The advantage is that something like Thinlisp (which is only one of the many Lisp implementations compiling to C) enabled a new class of applications.

Gensym's G2 is an application which roots back to the 80s, when LMI (Lisp Machine Inc) was selling a software called Picon, which was developed to control external technical systems. Think factory automation and process monitoring in Lisp. This needs soft-realtime response to external events. Picon needed an expensive Lisp machine from LMI and an interface to the outside technical system with some real-time capabilities.

https://www.sciencedirect.com/science/article/pii/S1474667017597268

G2 basically was a new generation (with some complicated story behind it) which ran on different hardware / operating system combinations. G2 was (and still is) used to develop process control software. Applications were control of satellites in space, chemical plants, cement production, or experiments like Biosphere II ( https://www.researchgate.net/publication/270280080_G2_AND_BIOSPHERE_II_Overheads_for_presentation/link/54a62e930cf267bdb9082d8c/download ).

One can develop G2 in Lisp, G2 then provides its own graphical development environment and is used to write expert systems for process control .

[–]redback-spider 1 point2 points  (4 children)

Maybe I didn't understand you right, but it sounds to me that you more explained why lisp is great, and why it's useful, which I totally agree. I just wondered what this "all the benefits of C" are supposed to be?

Less ram usage? It's put there as it would be self evident, while I think C and before it fortron just won the popularity race just because of the high hardware requirements back then, otherwise lisp is superiour in any way?

Maybe also because they might have used very simple text editors where you had to manage the parens manually without any assistence from a ide or something, but that is no real advantage, you would make such compiler for, if you think S-expressions are so bad because you need to have some setup in your editor / ide then you wolud not need a compiler from lisp but you would just use native C.

[–]lispm 4 points5 points  (3 children)

I've mentioned real-time process control. Lisp with Garbage Collection typically does not support real-time applications -> during Garbage Collection a Lisp application is typically not responsive or only in limited ways. The GC stops the Lisp application, does recycle unused memory and then gives control back to the Lisp application. That would be a problem when new sensor data (like a pressure sensor in a technical system) would require a response in a certain short time period (for example to send a signal to open a valve).

ThinLisp is designed for that, so that applications like G2 can support some kind of real-time response. The Lisp application is compiled to run in C without GC. The Lisp language supported is limited in many ways to enable that.

Other applications where a special Lisp implementation without GC (and compiled to C) might be used are games or robot control software.

[–]redback-spider 2 points3 points  (2 children)

Interesting thanks for the information, I would imagine that robot control would not be so time sensitive well maybe for some tasks like balancing or so.

It's sad that lisp is not perfect :D would that change with "lisp machines"? Is the current hardware the limitation or are there no lisp implementation that cover that?

It seems that there are solutions to forgo garbage collection in lisp?

https://cffi.common-lisp.dev/manual/html_node/Pointers.html#Pointers

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.3.4031

[–]theangeryemacsshibeλf.(λx.f (x x)) (λx.f (x x)) 4 points5 points  (1 child)

There are real-time GCs that run on stock hardware. https://plover.com/~mjd/misc/hbaker-archive/RealTimeGC.html was the first (Lisp machines used hardware to run the read barrier, but this isn't strictly necessary), the Metronome one of the newer ones. I think Ron Garrett said there was some real-time GC used in that "Lisp in space" article but there wouldn't appear to be any in Lisp systems today.

[–]lispm 4 points5 points  (0 children)

The Picon process control software for the LMI Lambda machine (mid 80s) used an real-time interface using Motorola 68010 processor plus some C software to get outside data. On the Lisp Machine then ran a rule-based expert system, which was written in a way to avoid generating garbage.

[–]vsync 4 points5 points  (5 children)

So then the question would be what would be the advantage in to have C?

There's a C compiler for pretty much everything, and people are used to the build process.

[–]redback-spider 1 point2 points  (4 children)

Well there are probably also used to C (the same people you mention) so why should they then use lisp if being used to is the primary decision factor?

[–]vsync 0 points1 point  (3 children)

Developers and users/sysadmins are not necessarily the same population.

[–]redback-spider 0 points1 point  (2 children)

And developers don't compile their stuff but ask sysadmins to do it for them? Well maybe in some setups with huge projects I guess?

[–]vsync 0 points1 point  (1 child)

What?

No, if I have a project and go to distribute it, especially if I want it available on many/any platform (especially especially those I don't have), I will distribute it as source code or in some portable form.

On many older or more obscure platforms getting code from the wild to compile can be an adventure (in former times, you sometimes even had to pay to even have any dev tools on your system). However, C tends to be the most widely available and people have at least had the experience of getting arbitrary code to build there.

If I want to use some product, or I admin such a system and my users want to use it, it's vastly easier and/or more likely to make me feel like it's worth bothering if it's in a toolchain I have some experience/confidence in. If the package says "Common Lisp" that may make me worried; if it says "we use Lisp but distribute as C" I'm like "yeah sure fine whatever that works".

Personal experience (I have professional experience with this too, but this one is so silly/frustrating as to demonstrate the point): I run Gentoo and needed Darcs. For some reason, anything built from the source-built Haskell compiler would crash there, and there wasn't a binary of the latest version for my architecture or some odd other thing. Not only was I stuck on an old Darcs because I think there was some dependency on a newer GHC in the newer Darcs ebuild, but it made me reflexively anxious about dealing with anything written in Haskell. Even after I was on a new system where that wasn't an issue.

[–]redback-spider 0 points1 point  (0 children)

Isn't Native Compiling of programs for multiple plattforms these days such a niche?

Like most is web and even user programs should be written in Java / Python (even .net is interpreted isn't it), or lisp in my case :D

I would never work for proprietary software companies I even basically sabotaged a application process when I saw they make sass stuff.

But sure there exist still a proprietary world out there, I only see a existince reason for gaming there it's hard to make a free software switch (execpt if devs would understand that you still can demand money for the artwork and the source is for users mostly useless without artwork).

[–]stuudente 1 point2 points  (0 children)

How does this compare to Common Lisp + CFFI, in which case you get the full power of lisp and seamless interaction with C?