An idea to defeat #GenerativeAI in #FreeSoftware:

Just use a #ProgrammingLanguage that isn’t popular (e.g. #Haskell or some #Lisp dialect) to write your code, but publish human-readable intermediate form of that code in the public code repositories (e.g. the C programming language). Share the actual source code privately with trusted contributors in non-public branches, and require GPG signatures on actual contributions.

You could argue that not sharing source code is against the GPL, but the GPL does allow you to share the code as a hard copy printed on paper and sent over snail mail. Or you can just wait until the person asking is an actual human that you can trust not to use the source code for LLM training.

LLMs are unable to learn unpopular programming languages because they don’t have a sufficient corpus of training data to learn how to code it, so if your receive a contribution in C, thank the contributor but inform them that they will have to rewrite the contribution in your Lisp dialect before you can accept it.

#Scheme dialects like #Gambit , #Chicken , and #Bigloo would work well for this. So would a #CommonLisp implementation that translates to C such as #ECL . Although keep in mind that the idea is to use a less popular language, so you may have to further obscure these languages a little bit, but not in a way that would be difficult for humans. For example, using a macro system, you could use df instead of define, rename types of things like string? to utf8str?, use generic functions with mulitple dispatch so append will work on strings, lists, vectors, and bytevectors. Small tweaks like this might throw-off an LLM asked to write source code in Lisp.

#tech #software #LLMs #LLM #FOSS #FLOSS #OpenSource #SchemeLang #R7RS

I was able to finish reading all of “The Genius of Lisp“ by @cdegroot and the whole book was as good as the free preview (chapter 8). I was able to speed-read through the detailed explanations of concepts I already knew, like tail recursion, garbage collection, the Y-combinator, Currying functions, and so on. But there were parts where I slowed down and read carefully, like the section on the Universal Turing Machine, and some of the details of the IBM-704 system architecture. Also the story of how the first Lisp implementation was created when one of McCarthy’s grad students implemented an M-Expression calculator, this was described in slightly more detail than what I recall McCarthy himself explaining in his 1960 paper — that or I had just forgotten those parts of the story.

The tone of this book reminds me a lot of popular physics books like Stephen Hawking’s “A Brief History of Time,” which was aimed more at general audiences than professionals. That said, there is a lot to enjoy about this book for professionals like myself as well. There are many good stories about the principals designers of Lisp throughout. The sections on the commercialization of Lisp for the first AI boom of the 1970s and it’s subsequent “AI winter,” were very interesting to read. And if you are a teacher, you might like how some of the concepts in the book are explained.

And I would definitely recommend this very strongly to 3rd-year high school students, or 1st and 2nd year college students, who are more genuinely curious about how computers work and want to know more than just how to make the next billion dollar app.

The next #LispyGopherClimate show with @screwlisp I look forward to talking about this book some more.

#tech #software #Lisp #ProgrammingLanguages #SchemeLang #Scheme #Clojure #Emacs #EmacsLisp #RetroComputing #LispyGopherClimateShow

The Genius Of Lisp

@badrihippo modern frameworks like React, Vue, and Van.js are all very similar, but I have not seen a consistent name for this family of frameworks. I have heard it called “The Elm Architecture,” because they are loosely based on how the Elm programming language originally did GUI programming in the browser. I have also heard it called the Model-View-Update paradigm. But most people just call it “React-like” or “Reactive Programming” because they are all similar to the very popular “React.js” framework.

Note that this should not be confused with Functional Reactive Programming (FRP), although the two are not completely different. As I understand it, React-like GUIs and FRP can both be implemented on top of a more powerful and more general computation model called “propagators” (here is the PDF of the original Propagators paper).

@dthompson wrote a really good blog post about FRP, propagators, and React-like frameworks.

I hope that helps, but I am not as well-versed in the theory of this stuff as I should be.

Oh, and I should say, before React-like took over the world wide web, GUI programming was mostly intertwined with Object Oriented Programming and design, so a good place to start might be to read up on Smalltalk OOP and GUI design.

#tech #software #GUI #ReactiveProgramming #FRP #Scheme #Haskell #SchemeLang #Propagators #ElmArchitecture #ReactJS #Smalltalk #OOP #ObjectOriented

The Elm Architecture · An Introduction to Elm

New book: “The Genius of Lisp” by Cees de Groot

Looks like a fascinating read! They have provided chapter 8 as a PDF file downloadable gratis as a sneak-peek into the rest of the book, guess what it’s about:

Chapter 8: Sussman and Steel make Scheme

Awesome! I can’t wait to read that chapter, and then the rest of the book!

Details on the book homepage: https://berksoft.ca/gol/

#tech #software #Lisp #Scheme #SchemeLang #R7RS

RE: https://mstdn.ca/@cdegroot/116086771614712320

#Schemacs update

I decided to merge my #Scheme react-like declarative GUI framework (schemacs ui), even though the back-end isn’t completely bug-free yet. (It is still an experimental software project, so the main branch is the development branch).

Though it is written in pure #R7RS “small” Scheme, the only GUI back-end currently available is for Guile users who go to the trouble to install Guile-GI all on their own.

If Guile-GI is installed, put on your safety goggles and run this command in the Guile REPL:

(load "./main-gui.scm")

I haven’t tried getting it to work in a Guix shell for almost a year now, but my last attempt did not go well (it crashed while initializing Gtk). To anyone who wants to try the GUI, I am sorry to inconvenience you, but I’m afraid I just have to ask you to please install Guile-GI yourself using the old-fashioned ./configure && make && make install method. If anyone happens to be able to get it to work in a Guix shell, please let me know, or open a PR on the Codeberg Git repository.

The only examples for how to use (schemacs ui) are in the test suite and the Schemacs Debugger. The only documentation so far are the comments in the source code, though I did try to be very thorough with comments.

The “Debugui” debugger works, but only has one single feature: the eval-expression command, which is bound to M-: (Alt-Colon). This command works the same as in #Emacs but you enter a Scheme language command instead. The #EmacsLisp interpreter is not yet connected to the GUI.

Now that this is merged, I am going to work on a few tasks in the Emacs Lisp interpreter that have been pending for more than a few weeks now. Then, back to creating new features in the GUI toward the goal of making it a useful program editor. And also, of course, writing some more documentation.

#tech #software #R7RS #SchemeLang

#Schemacs update

I have been banging my head against #Gtk3 for the past 3 weeks and all progress has pretty much come to a stand-still. No matter how simple and straight-forward my GUI is, Gtk makes it simply impossible to get the layout correct. I am now convinced that programming my own layout algorithm from scratch and using the GtkLayout container (which lets you place widgets at arbitrary X,Y coordinates) is the only way to proceed at this point. It is soooo frustrating.

The #Gtk documentation is good, but not at all good enough. The people on the Gnome Discourse have been very kind and helpful, and I truly appreciate the engagement I have had there, but ultimately I am still not able to solve my problems.

I have decided I need find some way to keep making progress without postponing the release of the work I have done so far for an indeterminate length of time. So rather than work out all the bugs in this version before merging it to the main Git branch, what I will do instead is have the main program launch a debugger window. The debugger window will have all layout calculated in advance, and all widgets will be declared once and only once throughout the lifetime of the application to avoid the reference counting issues. Obviously the debugger GUI will be very rigid, but you will at least be able to edit files and run commands in a REPL within this debugger.

Then maybe I can merge the code I have written to the main Git branch, and people will at least be able to use it through the debugger. Maybe also I could use this debugger to help with writing my layout algorithm. Also, I need to get back to the Emacs Lisp interpreter, I haven’t worked on it in almost two months now.

#tech #software #Lisp #Emacs #EmacsLisp #Scheme #SchemeLang #R7RS

Can't get GtkScrolledWindow to use all available space, seems to ignore "vexpand" and "valign"

(In Gtk3) I am ordering elements in a GtkApplicationWindow. The app window’s top-level layout container is a GtkBox with vertical orientation. The box contains two elements, a GtkScrolledWindow (with a GtkTextView inside of it), and GtkLabel below for reporting messages. I made sure the top-level Box and the GtkScrolledWindow both have their expand properties set to TRUE, and both have their valign and halign properties set to fill. I made sure to call pack_start with the expand and fill argume...

GNOME Discourse
Kent Pitman presents his lisp condition system implemented for python

PeerTube

@screwlisp @kentpitman I’m just reading up on the MIT-Scheme condition system. Recent efforts to standardize this are defined in SRFI-255: “Restarting conditions”.

An older standards condition systems in Scheme was defined in SRFI-35: “Conditions”. And #Guile users can use the Guile implementation of SRFI-35 to make use of it.

I wish I had known about this two weeks ago when we first started talking about it on the #LispyGopherClimate show, but better late than never, I guess.

#tech #software #Lisp #CommonLisp #Scheme #SchemeLang #R7RS #MITScheme #Guile #GuileScheme

Error System (MIT/GNU Scheme 12.1)

Error System (MIT/GNU Scheme 12.1)

@screwlisp @kentpitman regarding the discussion we had after the #LispyGopherClimate show ended, MiniKanren is logic programming language embedded in Scheme (sort-of like a Prolog implemented in Scheme and coded with S-expressions), and you can use machine leaning methods like neural networks to guide the search tree of the goal solver mechanism. This paper is an example of what I was talking about.

Even before LLMs were invented, MiniKanren was able to do program synthesis using purely symbolic logic. They developed a prototype called Barliman where you would provide example input->output pairs as constraints, and using a constraint solver, could generalize those examples to a function that generates any output for any input. As a simple example, you could give it the following input-output pairs:

  • () -> ()
  • (a) () -> (a)
  • () (a) -> (a)
  • (a) (a) -> (a a)
  • …and the constraint solver could determine that you are trying to implement the append function for lists and write the code automatically — without LLMs, using purely symbolic logic.

    As you might expect, the solver could be very slow, or even diverge (never returning an answer). The paper I mentioned above talks about using neural networks to try to guide the constraint solver to improve the performance and usefulness of the results returned by the solver.

    Now imagine applying this technique to other domains besides code generation or optimization, for example, auto-completion, or cache pre-fetching, and building it into a programmable computing environment like Emacs. You could have a tool like “Cursor,” but instead of using LLMs, it uses classical computing and constraint solvers, while taking a fraction of the amount of energy that LLMs use.

    #tech #software #AI #LLM #MachineLearning #NeuralNetwork #ConstraintLogic #ConstraintSolver #LogicProgramming #Prolog #MiniKanren #Emacs #Lisp #Scheme #SchemeLang #ProgramSynthesis

    Ouch, #Guile #Scheme has betrayed me

    I am using Guile-GI the GObject Introspection framework for Guile, and discovered that the eq? predicate sometimes returns #t for two different symbols. Does #GOOPS allow overloading eq? on symbols such that it can return #t on different symbols? If so this seems like a huge problem to me, it completely violates the Scheme language specification. (Or should I ask, is this a “GOOPS oopsie?”)

    Anyway, what happens is this: you can capture a Gtk keyboard event in an event handler, and extract the list of modifier keys pressed on that key event. It looks something like this:

    (lambda (event) (let*-values (((state-ok modifiers) (event:get-state event)) ((mod-bits) (modifier-type->number modifiers)) ((first-mod) (car mod-bits))) (display "first modifier: ") (write first-mod) (newline) (display "is symbol? ") (write (symbol? first-mod)) (newline) (display "eq? to 'mod1-mask: ") (write (eq? 'mod1-mask first-mod)) (newline) #t ))

    And the output of the above event handler, when I press a key with a CJK input method enabled (on latest Linux Mint) is this:

    first modifier: modifier-reserved-25-mask is symbol? #t eq? to 'mod1-mask: #t

    The fact that (eq? 'mod1-mask 'modifier-reserved-25-mask) when the 'modifier-reserved-25-mask has been obtained from a C-language FFI callback is a pretty bad thing to happen in a Scheme implementation, in my humble opinion.

    #tech #software #Schemacs #SchemeLang #R7RS

    guile-gi 0.3.2-0.388653a — Packages — GNU Guix

    GObject bindings for Guile