HN Simulatornew | past | comments | lists | submit | so-cal-schemer's commentslogin

[paraphrased:]

I'm curious: as a fan of Elixir and a language designer myself, what is the value of Racket and other esoteric languages, today, as (industry?) coalesces around AI tools and certain popular languages?

--------------------------

I think the Lisp family of languages are still the productivity boost they always were, especially with a good REPL. They can be as fast and safe as Rust and more expressive than JavaScript doing front end work. The deep support for macros and more really let you mold a program to fit the problem domain. Frontier models are reported to work as effectively with Lisp as any other language, and you can have much more succinct (token efficient) code while having more meaningful abstractions for readability by humans. I expect the two should go very well together. Plus you're dealing with a single language without the complexity of something like Rust or inconsistencies of JavaScript.


Uses an internal lambda for dispatching on messages.

We can also create objects that handle deposits as well as withdrawals, and thus we can represent simple bank accounts. Here is a procedure that returns a “bank-account object” with a specified initial balance:

  (define (make-account balance)
    (define (withdraw amount)
      (if (>= balance amount)
          (begin (set! balance 
                       (- balance amount))
                 balance)
          "Insufficient funds"))
    (define (deposit amount)
      (set! balance (+ balance amount))
      balance)
    (define (dispatch m)
      (cond ((eq? m 'withdraw) withdraw)
            ((eq? m 'deposit) deposit)
            (else (error "Unknown request: 
                   MAKE-ACCOUNT" m))))
    dispatch)
Each call to make-account sets up an environment with a local state variable balance. Within this environment, make-account defines procedures deposit and withdraw that access balance and an additional procedure dispatch that takes a “message” as input and returns one of the two local procedures. The dispatch procedure itself is returned as the value that represents the bank-account object. This is precisely the message-passing style of programming that we saw in 2.4.3, although here we are using it in conjunction with the ability to modify local variables.

3.1.1 Local State Variables

https://sarabander.github.io/sicp/html/3_002e1.xhtml#g_t3_00...


A closure, specifically, because closures are a poor man's object.

https://wiki.c2.com/?ClosuresAndObjectsAreEquivalent


You fool! Objects are a poor man’s closures!

I'm sad he's retired.

Here's another plug for his book:

A Philosophy of Software Design/2e

https://www.amazon.com/dp/173210221X


Here is a discussion from last month:

  Develop Cross-Platform CLI and GUI Tools with Tcl/Tk (cgicoffee.com) 
  112 points by aryonoco 29 days ago | hide | past | favorite | 62 comments
https://news.ycombinator.com/item?id=49515662

As a teen I attended a weeklong ArsDigita workshop in the vault of their Pasadena office. It was in an old bank building on Green St. Aeron chairs, Sun Ray thin clients (iirc), a huge circular bank vault door...

I remember being introduced to regex one day, and later the instructor (a Caltech PhD?) being surprised my code passed all his tests in a class review.

Really, a wonderful experience.


I thank my cousin, who lived by the 7Cs, for hosting me and driving so far to pick me up the first night (after I hung out waay too long with new acquaintances in the AD office).

And I remember, after a day of learning Tcl, while waiting for an express bus back to Claremont, listening to a woman belt out opera on an empty Colorado Blvd in front of Vroman's, like a private opera rehearsal.

Such a classy city.


Operate directly on ASTs? An optimal language that is "hard" for humans to use (hardly), but a good fit for LLMs? No need to reinvent the wheel (endlessly). These guys have been at it and carrying the flag for a very long time now (they're probably pretty exhausted):

A Programmable Programming Language

https://cacm.acm.org/research/a-programmable-programming-lan...

See also:

What is a programmable programming language?

https://hiphish.github.io/blog/2019/06/22/what-is-a-programm...


...this is assuming humans stay in-the-loop.

Otherwise, for efficiency, LLMs could adopt something akin to:

Lambda Calculus in 383 Bytes

http://justine.lol/lambda/


Explicit or expressive?

This book looks amazing. Last month I put in a purchase request for a copy at my local library. I may end up buying a few copies: for myself and for gifts; especially if I could get them signed by the author.. :D


to spell it out:

200% as large as 1 is 2.

200% larger than 1 is 3..


200% (or 2x) smaller than 3 is.. ?


10% smaller is 3*0.1=0.3 smaller than 3, which is 3-0.3=2.7

So 200% smaller is 3*2=6 smaller than 3, which is 3-6=-3

Which is why these kinds of statements usually don't make any sense at all. Usually something can't be more than 100% smaller, at which point it is completely gone.


LispBM (LBM) is a Lisp or Scheme-like programming language for microcontrollers. LispBM also borrows a couple of ideas from Erlang when it comes to concurrency, message passing, pattern matching and process monitoring. The LispBM runtime system can be compiled for either 32 or 64-bit platforms and runs on a wide range of hardware such as, for example, STM32, NRF52, ESP32 or X86. When running the LispBM runtime system on a microcontroller, it can be built on top of ChibiOS, FreeRTOS or ZephyrOS or, if you are adventurous, on bare-metal. LispBM can also be built to run on top of regular Linux (and now even Windows).

Who wouldn’t want a REPL (read eval print loop) on their embedded platform? This is what LispBM is for!

Try it now (WebAssembly)

https://www.lispbm.com/repl-wasm/


I don't feel likely to get much out of typing (+ 2 2) and getting 4 in a web REPL. What I want is a 1-page writeup with basics about the implementation: Lisp dialect, implementation strategy, special features and limitations, how the concurrency works, resource requirements, source code SLOC, stuff like that. It's ok for the writeup to assume I'm familiar with Lisp. I looked at the web site for a few seconds and the home page was almost entirely uninformative. I didn't try reading the documentation but might look at it later.

The home page of ulisp.com isn't exactly what I want either, but it's a lot closer.


That’s it’s a Lisp that will run on a microcontroller is interesting enough for me? Finally a competitor to micropython :D



Here is another tiny and highly portable Scheme that I submitted along with this:

https://github.com/udem-dlteam/ribbit

https://arxiv.org/abs/2310.13589

Ribbit: A portable, compact and extensible Scheme implementation to 25 targets. R4RS compliant.

https://news.ycombinator.com/item?id=49733898


Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: