HNHacker News
TopNewBestAskShowJobs

so-cal-schemer

88 karma · joined April 11, 2023

submissionscomments
so-cal-schemer··on RacketCon Is Saturday
[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.

so-cal-schemer··on LispBM is a concurrent Lisp for microcontrollers with message passing
Not to be confused with

https://research.scheme.org/lambda-papers/lambda-papers-rabb...

so-cal-schemer··on RacketCon Is Saturday
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...

so-cal-schemer··on RacketCon Is Saturday
I'd imagine they would require some hands-on guidance to create more meaningful abstractions and DSLs for humans.

Call it "vibe coding by tiller". Ha.

Also, I think of metalinguistic abstraction as something deeper than macros. At least not limited to macros:

"An important advantage of making the evaluator accessible as a Lisp program is that we can implement alternative evaluation rules by describing these as modifications to the evaluator program."

https://sarabander.github.io/sicp/html/Chapter-4.xhtml

so-cal-schemer··on Tcl/Tk 9.1
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

so-cal-schemer··on Tcl/Tk 9.1
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
so-cal-schemer··on Tcl/Tk 9.1
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.

so-cal-schemer··on Tcl/Tk 9.1
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.

so-cal-schemer··on A Programmable Programming Language (2018)
It seems to me that AI code generation and "bottom-up" program design -- or to an extreme, language oriented design -- could work well together to produce well organized code. Not only would it be more meaningful for human consumption, but it would be more token efficient too.

I'd rather read tight, meaningful abstractions in code than verbose, repetitive, simple code that many promote today.

As an aside, confabulations / hallucinations could be seen as a feature. At least in the world of LOP.

so-cal-schemer··on A Programmable Programming Language (2018)
I "vouched" this comment. Good point..

[why the down-voting? markers of AI?]

so-cal-schemer··on What makes Lisp difficult to read?
I wouldn't say "never ambiguous" (at least for Scheme):

140 Assignment introduces a subtlety into step 1 of the evaluation rule. As shown in Exercise 3.8, the presence of assignment allows us to write expressions that will produce different values depending on the order in which the subexpressions in a combination are evaluated. Thus, to be precise, we should specify an evaluation order in step 1 (e.g., left to right or right to left). However, this order should always be considered to be an implementation detail, and one should never write programs that depend on some particular order. For instance, a sophisticated compiler might optimize a program by varying the order in which subexpressions are evaluated.

https://sarabander.github.io/sicp/html/3_002e2.xhtml#FOOT140

so-cal-schemer··on A Programmable Programming Language (2018)
In the ideal world, software developers would analyze each problem in the language of its domain and then articulate solutions in matching terms. They could thus easily communicate with domain experts and separate problem-specific ideas from the details of general-purpose languages and specific program design decisions.

In the real world, however, programmers use a mainstream programming language someone else picked for them. To address this conflict, they resort to—and on occasion build their own—domain-specific languages embedded in the chosen language (embedded domain-specific languages, or eDSLs). For example, JavaScript programmers employ jQuery for interacting with the Document Object Model and React for dealing with events and concurrency. As developers solve their problems in appropriate eDSLs, they compose these solutions into one system; that is, they effectively write multilingual software in a common host language.

Sadly, multilingual eDSL programming is done today on an ad hoc basis and is rather cumbersome. To create and deploy a language, programmers usually must step outside the chosen language to set up configuration files and run compilation tools and link-in the resulting object-code files. Worse, the host languages fail to support the proper and sound integration of components in different eDSLs. Moreover, most available integrated development environments (IDEs) do not even understand eDSLs or perceive the presence of code written in eDSLs.

The goal of the Racket project is to explore this emerging idea of language-oriented programming, or LOP, at two different levels. At the practical level, the goal is to build a programming language that enables language-oriented software design. This language must facilitate easy creation of eDSLs, immediate development of components in these newly created languages, and integration of components in distinct eDSLs; Racket is available at http://racket-lang.org/

so-cal-schemer··on Evolving programming languages in the AI era
...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/

so-cal-schemer··on Evolving programming languages in the AI era
Explicit or expressive?
so-cal-schemer··on Evolving programming languages in the AI era
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...

so-cal-schemer··on The Secret Life of Circuits
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
so-cal-schemer··on Logo Programming
I'd love to take you out for coffee or lunch some day.
so-cal-schemer··on LispBM is a concurrent Lisp for microcontrollers with message passing
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

so-cal-schemer··on Bonsai 2 27B: Near-Lossless Compression in a 9x Smaller Footprint
200% (or 2x) smaller than 3 is.. ?
so-cal-schemer··on Bonsai 2 27B: Near-Lossless Compression in a 9x Smaller Footprint
to spell it out:

200% as large as 1 is 2.

200% larger than 1 is 3..

so-cal-schemer··on Logo Programming
It must have been a good introduction. I later aced bh's cs61a.
so-cal-schemer··on Logo Programming
Computer Science Logo Style Volume 1: Symbolic Computing

https://people.eecs.berkeley.edu/~bh/v1-toc2.html

Computer Science Logo Style Volume 2: Advanced Techniques

https://people.eecs.berkeley.edu/~bh/v2-toc2.html

Computer Science Logo Style Volume 3: Beyond Programming

https://people.eecs.berkeley.edu/~bh/v3-toc2.html

so-cal-schemer··on Ribbit: A Small Scheme VM, Compiler and REPL in 4K (2021) [video]
Compact language implementations are increasingly popular for use in resource constrained environments. For embedded applications such as robotics and home automation, it is useful to support a Read-Eval-Print-Loop (REPL) so that a basic level of interactive development is possible directly on the device. Due to its minimalistic design the Scheme language is particularly well suited for such applications and several implementations are available with different tradeoffs. In this paper we explain the design and implementation of a compact Scheme system that supports a REPL, is extensible and has a 4 KB executable code footprint.

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

https://arxiv.org/abs/2310.13589

Abstract.

The Ribbit system is a compact Scheme implementation running on the Ribbit Virtual Machine (RVM) that has been ported to a dozen host languages. It supports a simple Foreign Function Interface (FFI) allowing extensions to the RVM directly from the program’s source code. We have extended the system to offer conformance to the R4RS standard while staying as compact as possible. This leads to a R4RS compliant REPL that fits in an 7 KB Linux executable. This paper explains the various issues encountered and our solutions to make, arguably, the smallest R4RS conformant Scheme implementation of all time.

Previous:

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

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

Try the online R4RS REPL here :

https://udem-dlteam.github.io/ribbit/repl-r4rs-tc.html

so-cal-schemer··on LispBM is a concurrent Lisp for microcontrollers with message passing
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/

so-cal-schemer··on Learning Programming in an Age of LLMs
A good place to start:

https://sarabander.github.io/sicp/

so-cal-schemer··on Logo Programming
Logo on Apple //e computers was my first foray into programming.

I was entranced.

so-cal-schemer··on Logo Programming
There seems to be a lot of unreasonable down-voting happening these days.

You can click on the time-of-post to "vouch" for down-voted or "[dead]" comments to bring them back.

Otherwise, to read them, I will select the text which highlights it in high contrast. Ctl-A on many browsers or triple click on a paragraph.

so-cal-schemer··on Knuth: Literate Programming
A recent discussion:

   We should revisit literate programming in the agent era (silly.business)
   292 points by horseradish 6 months ago | hide | past | favorite | 266 comments
https://news.ycombinator.com/item?id=47300747
so-cal-schemer··on Knuth: Literate Programming
Literate programming is a methodology that combines a programming language with a documentation language, thereby making programs more robust, more portable, more easily maintained, and arguably more fun to write than programs that are written only in a high-level language. The main idea is to treat a program as a piece of literature, addressed to human beings rather than to a computer. The program is also viewed as a hypertext document, rather like the World Wide Web. (Indeed, I used the word WEB for this purpose long before CERN grabbed it!) This book is an anthology of essays including my early papers on related topics such as structured programming, as well as the article in The Computer Journal that launched Literate Programming itself. The articles have been revised, extended, and brought up to date.
so-cal-schemer··on Can AI design circuit boards yet?
Cool! Looks like a company that grew out of §3.3.4 of SICP. Hardware oriented NixOS and GUIX users should be very interested in this: declarative PCB designs.

3.3.4 A Simulator for Digital Circuits

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

3.3.5 Propagation of Constraints

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

2.1.4 Extended Exercise: Interval Arithmetic

https://sarabander.github.io/sicp/html/2_002e1.xhtml#g_t2_00...

Page 1 of 5Next →