Show HN: Lisp with GC in 436 Bytes

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SonarQube - Static code analysis for 29 languages.
  • Scout APM - Less time debugging, more time building
  • SaaSHub - Software Alternatives and Reviews
  • AIT

    Algorithmic Information Theory, using Binary Lambda Calculus

  • sectorlisp

    Bootstrapping LISP in a Boot Sector

    SectorLISP has always had a C implementation for explainability. It started off as ugly C because it was actually used to generate the assembly code for the first ~900 byte version. See https://github.com/jart/sectorlisp/blob/a561e031aec03270459f... and https://github.com/jart/sectorlisp/blob/a561e031aec03270459f... Once we reached 512 bytes I started deleting a lot of the C code since things like assembly macros weren't needed anymore, since the assembly was now being written by hand. https://github.com/jart/sectorlisp/blob/main/lisp.c

    Once I cleaned up the C code, I noticed that the entire program didn't use pointers at all! (Except of course to interop with Bestline, but that could be replaced with fgetwc() instead). That's when the idea occurred to me that, since it didn't use pointers, it was also technically valid JavaScript too. So I asked around on Twitter to see if anyone's done a C / JS polyglot before. I got some helpful tips from a code golfer in Estonia who experimented with the idea and he told me about the paragraph separator trick. https://twitter.com/angealbertini/status/1463755612345540611

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • Bazel

    a fast, scalable, multi-language and extensible build system

    I used to do a lot of work on Bazel. I wrote its downloader code for example. https://github.com/bazelbuild/bazel/commit/ed7ced0018dc5c5eb... Bazel is nice, but these days I'm running a small scrappy operation, so I just use GNU Make. https://github.com/jart/cosmopolitan/blob/7064d736e3ded15087...

    I like Make since it's able to build a repository with 17k .o files, 80 .a archives, and 661 .com executables from scratch in under a minute on one personal computer (if the kernel page cache is warm). I wrote a couple small helper commands to make the make config more manageable, like package.com, mkdeps.com, ar.com, zipobj.com, and runit.com.

    The reason why Make works for me, is because I think the root cause of needing things like Autoconf and Cmake is because most projects need to depend on seven different C libraries. I decided that, rather than devoting my energy towards writing a better build config, I'd just create a C library that runs on all seven of the platforms I'm targeting, using sources liberally borrowed from projects like musl, dlmalloc, dtoa, llvm, etc. Therefore, portability in Cosmopolitan is now abstracted by the system call wrappers, rather than being punted downstream to build configs.

  • cosmopolitan

    build-once run-anywhere c library

    I used to do a lot of work on Bazel. I wrote its downloader code for example. https://github.com/bazelbuild/bazel/commit/ed7ced0018dc5c5eb... Bazel is nice, but these days I'm running a small scrappy operation, so I just use GNU Make. https://github.com/jart/cosmopolitan/blob/7064d736e3ded15087...

    I like Make since it's able to build a repository with 17k .o files, 80 .a archives, and 661 .com executables from scratch in under a minute on one personal computer (if the kernel page cache is warm). I wrote a couple small helper commands to make the make config more manageable, like package.com, mkdeps.com, ar.com, zipobj.com, and runit.com.

    The reason why Make works for me, is because I think the root cause of needing things like Autoconf and Cmake is because most projects need to depend on seven different C libraries. I decided that, rather than devoting my energy towards writing a better build config, I'd just create a C library that runs on all seven of the platforms I'm targeting, using sources liberally borrowed from projects like musl, dlmalloc, dtoa, llvm, etc. Therefore, portability in Cosmopolitan is now abstracted by the system call wrappers, rather than being punted downstream to build configs.

  • nokolisp

    Lisp interpreter and compiler from 1977-1988 for MSDOS.

    My "compiler" was totally context-free and made in assembler. Which means that it compiles every instruction in complete vacuum and assumes stuff comes in AX and BX registers (with rest-pointer in CX, I think). And result in AX.

    But this proved not to be a bad start at all. Once you understand the limitations of the "compiler", you can modify the macros accordingly. One of the feature of the compiler was that it assigned absolute memory places for variables, so you could stop wasting stack and do early assignments to temporary variables.

    Unfortunately the source is quite incomprehensible now because of insane use of nested macros: https://github.com/timonoko/nokolisp

    But the example given above works, no doubt about it:

        > (setq test (ncompile '(cons 1 (cons 2 3))))

  • blamscript

    game scripting documentation for halo speedruns

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts