jackdaniel, to Lisp
@jackdaniel@functional.cafe avatar
  • [x] REPL line editing

illustration of line editor

jackdaniel, to Lisp
@jackdaniel@functional.cafe avatar

Towards CFG with explicit dynamic environment boundaries.

dekkzz76, to random
@dekkzz76@emacs.ch avatar
louis,
@louis@emacs.ch avatar

@dekkzz76 Adding some more notes: the project I've migrated from Go to Common Lisp resulted in 50% less code (not using any macros!).

Also, since I've developed it entirely in LispWorks, I did some tests with other implementations and it worked in SBCL and ECL out of the box (CLISP didn't work because bordeaux-threads doesn't support it).

Here are the runtimes:

SBCL:
Evaluation took:
9.755 seconds of real time
1.033166 seconds of total run time (0.968865 user, 0.064301 system)
[ Real times consist of 0.019 seconds GC time, and 9.736 seconds non-GC time. ]
[ Run times consist of 0.019 seconds GC time, and 1.015 seconds non-GC time. ]
10.59% CPU
144 lambdas converted
1 page fault
100,349,712 bytes consed

ECL:
real time : 83.908 secs
run time : 29.092 secs
gc count : 4 times
consed : 662005840 bytes

(sort of disappointing)

LispWorks:
User time = 2.220
System time = 0.118
Elapsed time = 9.028
Allocation = 60406728 bytes
1620 Page faults
GC time = 0.009

It seems LispWorks is the clear winner in terms of runtime/memory usage.

ramin_hal9001, to cpp
@ramin_hal9001@emacs.ch avatar

C++ is everywhere, that makes ECL very valuable.

The software industry, especially in the realm of free software, has mostly settled on a pattern of using C++ for creating performance critical libraries, and creating Python binding to the C++ libraries for scripting. I was hoping Rust might come along and change all this, but it will take decades.

In the mean time, if you want to use C++ but not actually write C++, you can make use of the ECL Common Lisp compiler, which can compile Lisp to C++ code. This gives you all the best features of Common Lisp for programming with the universe of C++ code libraries available to you. You can use a C++ library and still have Common Lisp macros, garbage collection, high-level scripting, S-expressions as serialization, domain specific languages, a proper meta-object protocol that wraps C++ classes nicely, and wealth of choices for functional programming systems from the untyped lambda calculus all the way up the lambda cube to System-F and the Calculus of Constructs. This not only makes ECL a viable alternative to Python for scripting and app development, but objectively better than Python since you can actually turn your Common Lisp scripts into code that gets compiled into a larger C++ application.

With ECL I would have all sorts of C++ libraries available to me:

  • game engines like Unreal and Godot
  • 3D modeling: FreeCAD, OpenSCAD, Blender
  • Machine learning, big data, and HPC with PyTorch, TensorFlow, OpenCV, OpenCL

I will continue to contribute to the Scheme and Haskell communities as much as I can. I will continue to pursue my dream of an Xfce-like desktop environment written in Scheme. But no matter how I look at it, I am going to more productive in the long run using ECL and C++.

I was hoping that the software industry would gradually shift over to better, more functional languages like Rust and Haskell. And I would love it if Scheme languages could ever begin to seriously replace Python as a scripting language. But realistically, I think I am going to change tack and meet the industry half way. I think I should probably start using ECL as my language of choice, as much as I would prefer Scheme or an ML-family language like Haskell.

ramin_hal9001,
@ramin_hal9001@emacs.ch avatar

My latest blog post: How is Lisp useful

This article actually started as a post on Lemmy, but it got to be so long that I turned it into a proper blog post.

I also include ideas from a post I made here on Mastodon earlier.

I hope you like it!

amoroso, to retrocomputing
@amoroso@fosstodon.org avatar

I run across the 1988 paper "Design and Implementation of the UW Illustrated Compiler" about an educational compiler, implemented in Interlisp-D, for a simple block structured language. The system took advantage of Interlisp-D's GUI and environment to visualize the compiler's scanning, parsing, and code generation features and state.

https://dl.acm.org/doi/pdf/10.1145/53990.54001

jackdaniel,
@jackdaniel@functional.cafe avatar

@amoroso I'm using to visualize compilation steps. The tool is not anywhere near being usable for anyone but me, yet it gives a good insight at what's going on and helped me to spot a few type propagation bugs.

As far as I remember cleavir has more complete tooling for visual inspecting of the compiler state, but I don't know details of that tooling.

screwtape, to Lisp
@screwtape@mastodon.sdf.org avatar

y on only on @SDF public access unix.
0. in NZ

  1. and not cold booting one's

  2. And hence stapling an user interface other than streams to my planner bot from old computer challenge

  3. Some new gophers arrive from activitypub @silverwizard @nuintari . But what is item type t from silverwizard's static site generator?

  4. DWIMification jokes in @alexshendi 's part of the last show's thread

~chat irc

screwtape,
@screwtape@mastodon.sdf.org avatar

@alexshendi @SDF @silverwizard @nuintari
It would make my life easiest if we were to use
irc.tilde.chat but I shall try and join irc.libera.chat since that is where the and and @jackdaniel are ! I got a bit behind on things this week sorry.

for the - tune in in about two hours, or earlier to catch @northernlights both on sdf commode chat and bytes willing, on irc.libera.chat !

https://anonradio.net:8443/anonradio

(scroll up for a few more details)

screwtape, to Lisp
@screwtape@mastodon.sdf.org avatar

y Wed000UTC


@kentpitman
I yell (toot) at an NZ Climate justice thinktank
LLM suggests we encrypt everything and "honeypot" it with junk content

final phosts
(ironically) https://occ.deadnet.se
Anyone remember who did old computer synth ?


@nutilius followup
@surabax is launching https://lisp.ie
@pkw , me, sort've @jackdaniel projects !

art @prahou

screwtape,
@screwtape@mastodon.sdf.org avatar

@fstateaudio @nutilius @surabax @pkw @kentpitman @prahou @SDF @chris @simon_brooke @lispi314 @rml @strypey @alexshendi @happy

( )
Next week, in theme with and development I will also be hanging around , both ~chat and liberachat. If anyone knows any good channels for the show chat to hang out in, please do tell.

nutilius, to Lisp
@nutilius@social.sdf.org avatar

Day 4
More tests with SBC and - oh no! ... it's again (and ). Another probe to learn, understand and use ... (why interpreter is more friendly for me than ).

Greetings from 512MB Gopherhole

gopher://sdf.org/0/users/nutilius/occ-2023/2023-07-13

screwtape,
@screwtape@mastodon.sdf.org avatar

@nutilius @louis @svetlyak40wt
prefix-> maybe package namespaces?
(defpackage "my-package-foo" (:use :cl) (:nicknames :foo))
(in-package :Foo)
(defun hello () "(hello) -> 'hello-world"
(values 'hello-world))
(in-package :cl-user)
> (foo::hello)
HELLO-WORLD

if you know C well, which I kinda do, @jackdaniel 's compiler is amazing. There's a special form #'ffi:c-progn that lets you interleave C and lisp code, sharing variables. Though new C functionality must be 'compile-file -d in.

ramin_hal9001, to random
@ramin_hal9001@emacs.ch avatar

Really cool post by someone called "Vito Van" who wrote a game in and tried to get it to run in the browser. He tried an () to C to pipeline with but was not able to pull in the necessary graphics dependencies.

Then he tried JSCL, a Common Lisp to JavaScript compiler that is implemented in Common Lisp and so it can bootstrap itself with any standard Common Lisp compiler.

I learned about a lot of Common Lisp on the Web technologies I had never heard of before, it was well worth it to read.

ramin_hal9001, to random
@ramin_hal9001@emacs.ch avatar

I just built and installed ECL (hompage) onto my computer, and after playing around with it for only a few minutes, I am quite impressed with it!

  • First off, the entire installation is only 40 MB, so this is definitely one of the more compact Common Lisp implementations I have ever seen.
  • It emits C code, native shared libraries, native static libraries, and native executables.
  • It uses libffi for C interoperability.
  • It provides ASDF, and the ability to install packages from QuickLisp
  • It implements Lisp standard processes on top of Pthreads
  • It provides some bindings to Qt4 for GUI programming
  • It implements all of CLOS

All of that in just 40 MB (not including Qt, which you need to install separately). The only drawback so far is that the documentation has some gaps in it.

But I definitely want to play around with some more. The trouble is most Common Lisp packages written nowadays only support SBCL. I would like to see how much of the Common Lisp ecosystem I can actually use through ECL. I wonder if I could maybe port something like the Lem text editor over to ECL instead of building it with SBCL, but that might prove impossible.

Anyway, my overall impression right now is that I have a very lightweight but powerful Common Lisp compiler at my disposal now that can easily be embedded into any C program I want, which is very exciting!

Thanks to @screwtape and @rml and @louis for turning me onto ECL!

louis,
@louis@emacs.ch avatar

@ramin_hal9001 @screwtape @rml Thank you so much for sharing your first experience with . I'll definitively try to work more with it.

has a great developer experience especially the type checking etc. Let's see how ECL is doing in this regard.

rml,
@rml@functional.cafe avatar

@ramin_hal9001 @louis @screwtape
fwiw I'm looking at the installation rn, and running
$ guix shell ecl
[env]$ cd $GUIX_ENVIRONMENT/bin
[env]$ du -h ecl
4.0K ecl

thats extremely impressive. I don't know if thats because the ecl binary primarily calls libraries (perhaps for fine grain modularity), or if its actually that small.

fwiw, with all it's deps included:
[env]$ cd $GUIX_ENVIRONMENT
[env]$ du . -h
20K ./lib/pkgconfig
180K ./lib
48K ./include
24K ./share/info
24K ./share/doc
20K ./share/man/man3
24K ./share/man
76K ./share
8.0K ./etc

320K .

in comparison:
$ guix shell chez-scheme
[env]$ cd $GUIX_ENVIRONMENT/bin
[env]$ du -h scheme
308K

[env]$ cd $GUIX_ENVIRONMENT
[env]$ du . -h
312K ./bin
8.0K ./etc
776K ./lib/csv9.5.8/examples
3.3M ./lib/csv9.5.8/ta6le
4.0M ./lib/csv9.5.8
4.0M ./lib
12K ./share/doc/chez-scheme-9.5.8
12K ./share/doc
12K ./share/man/man1
12K ./share/man
24K ./share
4.4M .

and the binary is tiny, but its dynamically linked & the full install is ~55MiB on guix

screwtape,
@screwtape@mastodon.sdf.org avatar

@ramin_hal9001 @rml @louis
adjacently, one of the cool people shared with me the commit from 6 months ago adding compilation support to
https://itch.io/post/7892451#:~:text=vitovan-,3%20hours%20ago,-(%2B1)
Now how many hours do I actually have left to figure this <_>

rml,
@rml@functional.cafe avatar

@civodul @screwtape @louis @ramin_hal9001

actually, I realized I wasn't in the main folder in the store, because I have ecl installed. so ecl is actually:
24K ./bin
8.0K ./etc
0 ./include/ecl/gc/private
0 ./include/ecl/gc
28K ./include/ecl/impl
360K ./include/ecl
360K ./include
920K ./lib/ecl-21.2.1/encodings
9.4M ./lib/ecl-21.2.1
13M ./lib
4.0K ./share/doc/ecl-21.2.1
4.0K ./share/doc
136K ./share/info
8.0K ./share/man/man1
8.0K ./share/man
148K ./share
14M .

But Chez was correct! So is actually much smaller than

schnouki, to random
@schnouki@async.social avatar

TIL: every run of has the same initial *random-state*, so sequences of pseudo-random numbers are not so random. The solution is super simple: (setf *random-state* (make-random-state t)).
It makes sense considering what a image is... but it's still pretty surprising compared to other programming languages. (And doesn't happen in or 😅)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • thenastyranch
  • magazineikmin
  • everett
  • InstantRegret
  • rosin
  • Youngstown
  • slotface
  • love
  • khanakhh
  • kavyap
  • tacticalgear
  • GTA5RPClips
  • DreamBathrooms
  • megavids
  • modclub
  • mdbf
  • tester
  • Durango
  • ethstaker
  • osvaldo12
  • cubers
  • ngwrru68w68
  • provamag3
  • normalnudes
  • Leos
  • cisconetworking
  • JUstTest
  • All magazines