← Home ← Back to /g/

Thread 105711980

317 posts 116 images /g/
Anonymous No.105711980 >>105712747 >>105713134 >>105729223 >>105744717 >>105776770
(λ) - ᵋLisp General
>Lisp is a family of programming languages with a long history and a distinctive parenthesized prefix notation. There are many dialects of Lisp, including Common Lisp, Scheme, Clojure and Elisp.

>Emacs is an extensible, customizable, self-documenting free/libre text editor and computing environment, with a Lisp interpreter at its core.

>Emacs Resources
https://gnu.org/s/emacs
https://github.com/emacs-tw/awesome-emacs
https://github.com/systemcrafters/crafted-emacs

>Learning Emacs
C-h t (Interactive Tutorial)
https://emacs.amodernist.com
https://systemcrafters.net/emacs-from-scratch
http://xahlee.info/emacs
https://emacs.tv

>Emacs Distros
https://spacemacs.org
https://doomemacs.org

>Elisp
Docs: C-h f [function] C-h v [variable] C-h k [keybinding] C-h m [mode] M-x ielm [REPL]
https://gnu.org/s/emacs/manual/eintr.html
https://gnu.org/s/emacs/manual/elisp.html
https://github.com/emacs-tw/awesome-elisp

>Common Lisp
https://lispcookbook.github.io/cl-cookbook
https://cs.cmu.edu/~dst/LispBook
https://gigamonkeys.com/book
https://lem-project.github.io
https://stumpwm.github.io
https://nyxt-browser.com
https://awesome-cl.com

>Scheme
https://scheme.org
https://try.scheme.org
https://get.scheme.org
https://books.scheme.org
https://standards.scheme.org
https://go.scheme.org/awesome
https://research.scheme.org/lambda-papers

>Clojure
https://clojure.org
https://tryclojure.org
https://clojure-doc.org
https://www.clojure-toolbox.com
https://mooc.fi/courses/2014/clojure
https://clojure.org/community/resources

>Other
https://github.com/dundalek/awesome-lisp-languages

>Guix
https://guix.gnu.org
https://nonguix.org
https://systemcrafters.net/craft-your-system-with-guix
https://futurile.net/resources/guix
https://github.com/franzos/awesome-guix

>SICP/HtDP
https://web.mit.edu/6.001/6.037/sicp.pdf
https://htdp.org

>More Lisp Resources
https://rentry.org/lispresources

(setq *prev-bread* >>105652614)
Anonymous No.105711984 >>105712003 >>105712364
scheme
Anonymous No.105711997
Gensokyo Emacs 4tw
https://youtu.be/RPeFQwBFURk?t=1623
Anonymous No.105712003 >>105712042 >>105712062 >>105712136 >>105725684
>>105711984
Is not a Lisp
Anonymous No.105712042 >>105712136 >>105725684
>>105712003
it has the lisp primitives as stated by John McCarthy, unlike clojure.
Anonymous No.105712062
>>105712003
My favorite Lisp is Pyramid Scheme
https://esolangs.org/wiki/Pyramid_Scheme
Anonymous No.105712136 >>105715869
>>105712003
>>105712042
>common lisp
>isn't common
Anonymous No.105712257
>>105711000
Claude is 100% better at programming elisp than Chatgpt shit. Yesterday I cried and kneeled. I made my own package at once. Ngl It was magical.
Anonymous No.105712313 >>105712428
(ba-bomb-sh-ka)
https://babashka.org
Anonymous No.105712364 >>105793314 >>105793429
>>105711984
try unix ed written in chicken scheme
https://github.com/nmeum/edward
Anonymous No.105712428
>>105712313
Um...
http://xahlee.org/p/um/um.html
Anonymous No.105712747 >>105712867 >>105712939
>>105711980 (OP)
I wish I were a girl too
Anonymous No.105712867 >>105785245
>>105712747
>girl
I'd just like to interject for a moment. What you're referring to as Girl, is in fact, GNU/Virgins, or as I've recently taken to calling it, GNU plus Virgins.
>Then if you become a hacker you can celebrate that by having a foobar mitzvah, a ceremony in which the new hacker stands in front of the assembled congregation of hackers and chants through the lines of the system source code. And we also have the cult of the virgin of emacs. The virgin of emacs is any female who has not yet learned how to use emacs. And in the church of emacs we believe that taking her emacs virginity away is a blessed act.
https://archive.is/urcla
Anonymous No.105712939 >>105712942 >>105712986
>>105712747
No judgement on anyone but how many people here have unironic gender dysphoria? I just want to get an idea.
Anonymous No.105712942
>>105712939
what kind of person unironically wants to be male?
Anonymous No.105712986
>>105712939
nil
lisp hackers are always chads
Anonymous No.105713134
>>105711980 (OP)
i'm just trying Racket and its gui lib and it's pretty cool so far, i didn't expect a decent GUI out of most languages.
did anybody else try it? i'm willing to switch to a web interface eventually. should i just use web with Racket from the start or stick to the native GUI?
Anonymous No.105713462 >>105713527 >>105713741 >>105713848 >>105715041
Why did MIT dumb down its basic CS course 6.001 in 2008?
Anonymous No.105713527 >>105714884 >>105735000
>>105713462
the people got dumber
Anonymous No.105713741 >>105715194 >>105715993
>>105713462
Metacircular interpreters are useless
Anonymous No.105713848 >>105714019
>>105713462
Sussman is still scheming with SICP at MIT
https://groups.csail.mit.edu/mac/users/gjs/6.945/
Anonymous No.105714019
>>105713848
I love this retarded shit.
Anonymous No.105714884
>>105713527
This. People got dumber and standards of educational have been correspondingly depressed.
Anonymous No.105715041 >>105715239 >>105735000
>>105713462
old courses like sicp are now obsolete. today, programmers will never start from zero but will have to compose with libraries, sdks and ai.
Anonymous No.105715194 >>105715593
>>105713741
SICP isn't about utility. It's not a coding bootcamp that spits you out the other end ready to fuck up some corporate codebase. It is obtuse because it teaches computation itself. Scheme was chosen not because it's the most commercially competitive language but because it can teach you how to think like a machine.
Anonymous No.105715239 >>105715573
>>105715041
I think it's probably gonna take twenty years for people to really understand this, but I'm confident that you're wrong.
Anonymous No.105715573
>>105715239
that's sussman and abelson opinion; they talked during the last racketcon and said sicp was no more adapted to the kind of development you would do today. Sussman was trying to get rid of the sicp course at MIT for more than ten years when they finally ditched it.
Anonymous No.105715593 >>105715993
>>105715194
I think you perceive "usefulness" in a very narrow sense. IMO, metacircular interpreters are useless, but that's not because they're weird and obscure and can't be used for yet another JS framework, that's because there is literally no use for them (at least I'm not aware of one). In comparison, a lot of weird&obscure stuff is much more useful (and also very beautiful) - like Futamura projections or abstract interpretation or linear logic.

Maybe you think that metacircular evaluators are helpful for learning, but in my experience, implementing λ-calculus in Prolog was much more enlightening compared to implementing λ-calculus in λ-calculus. I think people should focus less on chapter 4 and more on chapter 5. Or perhaps different people are enlightened by different ideas in different proportions. Then we should try to predict the student's flavor somehow and give him a book that fits him better.
Anonymous No.105715869
>>105712136
That’s more due to a rising population of imbeciles.
Anonymous No.105715993 >>105716313 >>105716677
>>105713741
>>105715593
>metacircular
>useless
Wrong. GNU Mes uses a metacircular evaluator to achieve the full-source bootstrap of Guix. It's very useful.
https://www.gnu.org/software/mes/manual/html_node/LISP-as-Maxwell_0027s-Equations-of-Software.html
https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-building-from-source-all-the-way-down/
Anonymous No.105716313 >>105716677
>>105715993
Technically, when you bootstrap something, you implement a different language, so that's not true metacircularity.

When you say "this implementation is metacircular" you don't provide much value over just saying "this is an implementation of X in X". The only interesting fact you can deduce from here is that this implementation can be safely thrown away if you actually use it somewhere. There is no point in such implementations. The actual meat is in implementing something different. And the greater the difference, the better, since it shortens your bootstrap chain when you go from assembly to a high-level language.

And there is no "beautiful" metacircularity in the Mes sources. Or at least I was unable to find definitions similar to those in your first link with quick grepping. Everything is based on primitives implemented in C.

Also, I think that while full-source bootstrapping is nice to have in some abstract sense, it's not a complete solution. Or, to be more precise, it is a solution on a software level, but in practice, you also must rely on your hardware and trust the chip producer (be it chip designer or chip fabber or someone in between).
Anonymous No.105716677 >>105717314 >>105717373 >>105719494
>>105716313
>>105715993
I've been studying metacircular evaluators and just figured out how the binary lambda calculus self reductor works.
I'd say the biggest benefit to doing it is just showing how dead simple a programming language is. You can implement lambda calculus in like 3 lines of itself.
The point of doing this is that it lets you reason about how a language works without ever having to touch an implementation or learn another lower level language.
It also exposed me to a lot of type theory stuff incidentally which was interesting. It's a perfect academic method for introducing programming at it's core and lets you start off simple and add more and more language features in simple intuitive ways without ever falling into low level bullshit. So far I've gotten into lambda calculus, type theory, logic programming, and computability all through metacircular evaluators!
Finally it means once you understand the high level self evaluation, you can just translate that directly into a low level interpreter instead of working it out step by step. Also it makes porting incredibly easy. Like how I learned about interaction combinators and how they can be run massively in parallel automatically for huge speedups over C code.
Anonymous No.105717314 >>105717725
>>105716677
>You can implement lambda calculus in like 3 lines of itself
[citation needed]
Anonymous No.105717373 >>105717725
>>105716677
>Like how I learned about interaction combinators and how they can be run massively in parallel automatically for huge speedups over C code.
Requesting explanation.
Anonymous No.105717725 >>105717785 >>105722333
>>105717314
>https://anthonylorenhart.com/2021-09-04-Extremely-Simple-Self-Interpretation/
λ[Y[λ[λ[λ[
1[λ[λ[4[1][λ[λ[0[2][4]]]]]]]
[λ[1[λ[λ[λ[1[λ[7[4[λ[λ[λ[0[3]]]]]][λ[λ[1]]]]]]]]]
[λ[4[1[0]]]]]]
[λ[1[0][λ[4[λ[λ[λ[0[λ[λ[λ[2[7][10[6][λ[λ[1]]]]]]]]]]]]]]]]
]
]]][0][λ[λ[1]]]]

Though it's simpler to read it as
app = λ[λ[λ[λ[λ[2[4][3]]]]]];
lam = λ[λ[λ[λ[1[3]]]]];
var = λ[λ[λ[λ[0[3]]]]];

spine (app a b) l = spine a (b:l)
spine (lam f) (a:l) = spine (f a) l
spine (lam f) [] = lam (λ x . spine (f (var x)) [])
spine (var x) (a:l) = spine (var (app x (spine a []))) l
spine (var x) [] = x


>>105717373
>https://zicklag.katharos.group/blog/interaction-nets-combinators-calculus/
>https://github.com/HigherOrderCO/HVM/blob/73da3bbc4b222fb8f044fcc5dad202e9752a0abc/HOW.md
Basically interaction combinators are a model of computation like lambda calculus, only they're a graph instead of a tree and are evaluated in parallel instead of serially. They're entirely general and turing complete, and there's a GPU runtime that can process them with thousands of threads at a time. The base interpretation is about 10x-100x slower than conventional languages, but then you add in 10,000 threads running in parallel and suddenly it's an order of magnitiude faster than even optimized machine code(for massively parallel algorithms, it's still slow as balls for serial operations)
Anonymous No.105717785
>>105717725
There's also some other interesting shit related to/based on interaction combinators by the same guy.
There's a statically typed formal proof checker based on construction calculus(perfect for the static compilation autist who posts here occasionally), though hilariously it's written in 400 lines of PVRE JAVASCRIPT.
Also I'm like 90% sure that the type inference system in that can be repurposed into a logic programming language. And the major point of the entire thing is that it allows breaking beta reduction into O(1) steps, meaning it can be implemented in hardware, solving the entire graph reduction accelerator problem at the root.

Oh also the entire thing is automatically seamlessly garbage collected in parallel(the deletion operation is just one of the base primitives and runs like any other instruction deleting all unused data).
Anonymous No.105717910 >>105717993 >>105718021 >>105718330
after about a day of deliberating whether i want to learn common lisp or scheme (racket) as my first lisp, i decided to commit to the latter.
my question is this: does it really even matter? is the difference between the two even significant when it comes to learning lisp as a whole? i mean, they're both lisp at the end of the day, right?
Anonymous No.105717993
>>105717910
It's basically the same, 80% of the time the only difference is aethetic(scheme usually loots "neater"), the other 20% of the time it's just which has the libraries you want(common lisp has quicklisp which is king of convenience)
Then all the dozen or so schemes are basically identical but all have incompatible library/hardware/compiler support.

I use common lisp, but literally ONLY because I like the emacs mode better than the one for scheme.
Anonymous No.105718021 >>105718107 >>105726950
>>105717910
Pure scheme is a meme. You are 99% will end up with an implementation-specific features to do any real work. At that point, you might as well as using CL.
Anonymous No.105718107 >>105718143
>>105718021
>implementation-specific features
i'm not sure what you mean by that. do you mean features of the language that i would have to implement myself as opposed to relying on a library? isn't that sort of the whole point of lisp?
Anonymous No.105718143 >>105726950
>>105718107
It means every implementation of scheme is actually a slightly different language. Basically "scheme" doesn't really exist, there's just racket/gambit/chicken/chez/etc...
It's like lisp pre common lisp.
Anonymous No.105718330
>>105717910
Racket is great. Also, Felleisen's books are great.
https://felleisen.org/matthias/books.html
Even Cloudflare uses Racket extensively nowadays.
https://blog.cloudflare.com/topaz-policy-engine-design/
Anonymous No.105719431 >>105719486 >>105719494 >>105720189 >>105726825 >>105727985
In scheme if you want to set 2 or more variables whose values all depend on the same condition, which way would you use? Or are there other ways?

;; Method A
(let ((a (if c something-a something-else-a))
(b (if c something-b something-else-b))
...)
...)

;; Method B
(let ((a #f)
(b #f)
...)
(if c
(begin
(set! a something-a)
(set! b something-b)
...)
(begin
(set! a something-else-a)
(set! b something-else-b)
...))
...)

;; Method C
(let-values (((a b ...)
(if condition
(values something-a something-b ...)
(values something-else-a something-else-b ...))))
...)
Anonymous No.105719486
>>105719431
definitely C
Anonymous No.105719494 >>105719645 >>105719796
>>105716677
>You can implement lambda calculus in like 3 lines of itself.
If you are talking about something like this:
(define (e expr env)
(match expr
(('λ arg-name body) (λ (arg) (e body (λ (name) (if (eq? name arg-name) arg (env name))))))
((f arg) ((e f env) (e arg env)))
(var (env var))))
then I think it's a bad example. Here functions of the object language are represented via functions of the metalanguage (the part with (λ (arg) ...)). Depending on the semantics of your metalanguage (specifically, how it handles closures) you will implement different languages. The metacircularity allows you to "cheat" and don't specify the semantics of your object language in enough detail. In contrast, implementing λ-calculus in a different enough language (say, assembly or Prolog) forces you to explicitly state that closures copy the environment in which they are created (or do not copy, if you're making something like C with GCC extensions for nested functions instead of λ-calculus). Of course, you can do that as well in λ-calculus but then implementing λ-calculus in λ-calculus doesn't grant you anything and is not special in any way.
>>105719431
Honestly I would use the method that looks better in the particular case. Probably A if I have only 2-3 variables, B if something-a etc. are huge expressions and C if they're small expressions. It's only a matter of taste.
Anonymous No.105719645 >>105719802
>>105719494
>probably A
no, C is always the correct choice here. it minimizes conditional checks. it makes state transition explicit (this situation is literally what VALUES is for).
Anonymous No.105719796
>>105719494
>implementing λ-calculus in λ-calculus doesn't grant you anything and is not special in any way.
It's useful as a learning exercise. It's a decently varied and complicated program both to implement and read, but simple and short enough to be reasonable.
The whole point of lambda calculus is that it's extremely minimalist, which means writing an interpreter is much faster than any other language, and doing it in itself means your effort isn't split into learning two things at once.
Then lambda calculus has all sorts of interesting variants with type systems and proofs, etc... which you can now also try implementing the same way, it's a good stepoff point.
Anonymous No.105719802 >>105719884
>>105719645
But there is only one condition check in B as well? Also if you think that using two/three ifs instead of one is significant overhead that may matter somewhere, you should provide a benchmark. Or, if we are in that kind of discussion (low-quality argument about performance without any concrete code and godbolt links), I can just say that CSE will factor out condition if it's not just some variable (you ARE using an optimizing compiler, aren't you?) and branch predictor will have no trouble choosing the correct branch and in modern processors it's extremely hard to say whether one extra instruction is harmful or helpful without looking at the surrounding code.
>it makes state transition explicit
I'm not sure I completely understand what you mean by "state transition" but presumably B makes it explicit too?
>(this situation is literally what VALUES is for)
It looks like R7RS says nothing about how values or let-values should be used, only defines their behavior. There is no provided rationale.

The problem with method C in my opinion is that it's hard to see which expression corresponds to which variable, especially if they're big or if there are lots of variables.
Anonymous No.105719884
>>105719802
I'm in nicotine withdrawal so sorry if I come across as an asshole. B is absolutely trash of an option, it requires the programmer to scan the body of the LET to even determine that A and B are being set. this is a core complaint that I have with any imperative language, where you can enter however many levels of scopes and have absolutely zero idea of what shit is being mutated without checking every individual line.
functional, immutable languages require the programmer to explicitly return changed values from their scopes such that upper scopes must explicitly assign to those changes. when the programmer loops at the assignment, he knows exactly what variables will be changed without needing to consult any of the lower scopes, which massively aids readability.
I do not give a fuck about the performance, I give a fuck about DRY, where you are needlessly repeating a conditional call.
as for the spec not discussing the "purpose" of values, I do not give a fuck about that either. its purpose is able to be inferred quite easily by anyone with over a decade of experience programming.
Anonymous No.105720189
>>105719431
Definitely A, there's all sorts of ways to do this(macros, closures, mutation, etc...)
But really what are you saving? FOUR CHARACTERS "(if)" per variable?
And in the process making everything really confusing and weird for no reason. The macro is actually the least insane method and it's obviously massive overkill.
Anonymous No.105721812
(shr-dom-to-xml `(html ((lang . "en"))
(head ()
(title () "Generate HTML with Elisp"))
(body ()
(h1 () "Hello"))))

Undocumented but useful;
Anonymous No.105722333 >>105725774
>>105717725
>only they're a graph instead of a tree
all trees are graphs, a tree is just acyclic, rooted, and connected
Anonymous No.105722355 >>105723545
>Q: Outside the C family of languages, what language(s) do you like the best? What in particular makes them interesting to you?
>Ritchie: I have to admire languages like Lisp. But, just as in the earlier question about a "simple" language, an astonishingly simple language grows in practice into something that can be fearsome.
>Stroustrup: Algol68, CLOS, and ML springs to mind. In each case, what attracts me is flexibility and some very elegant code examples.
I honestly do not understand how Bjarne could say he admired CLOS but then he implemented C++ classes in almost the most antithetical way possible.
Anonymous No.105723545
>>105722355
I think C++ predates CLOS, so (to be charitable to Bjarne) maybe he's admiring what CLOS did differently.
Anonymous No.105725072 >>105762334
That CL trading book is really interesting, but he glosses over some stuff and the code is not that great imo. Clearly the guy is rich and got rich of trading, but I'm basing myself in his ideas and writing a clearer agent based trading thing.
Anonymous No.105725318 >>105740619 >>105743026
Reposting the window scripts for anyone who hasn't seen them, and while I'm at it, I'd like to ask more about emacs documentation standards. I've always been fairly good about inline comments, and I try to write my code in a way where you can infer a lot from context, but docstrings have always been something I'm an utter nigger about. I also can't rely on my own intuition with Elisp, as I'm a newfag at it.
What are the minimal criteria in your opinions about docstrings, and what separates an okay docstring from a great one?
Thanks

https://pastebin.com/rgMtnRhd
https://pastebin.com/nsmmvTat
Anonymous No.105725684 >>105735957
>>105712003
>>105712042
>Smug Common Lisp Weenies gatekeeping the definition of Lisp again
Lisp could have been more popular by now if CL didn't exist and Schemers didn't throw a tantrum over R6RS.
Anonymous No.105725774 >>105725834 >>105725853
>>105722333
>all trees are graphs
Every data structure is either a large graph, or a group of graphs. Everything boils down to graphs.
Perhaps Lisp should have been defined in terms of graphs instead of cons cells, to keep it simpler.
Anonymous No.105725834
>>105725774
Reading your post made me think about the definition of data structure.
Is a data structure just an (un)ordered set of (type, name, value) tuples?
Anonymous No.105725853 >>105725916
>>105725774
A set is not, since you have to define it as a set of singleton graphs, but then you're left with the problem that you need to know what a set is in order to make that definition, and you need to know what a set is in order to define a set of vertices and edges in the first place.
Anonymous No.105725916 >>105725957
>>105725853
You can model a set as a graph by having a semantic node for the set itself, and nodes for each possible element, the inclusion would be modeled as edges from the semantic node to the element nodes. Obviously this is intractable in typical ways, but you can model it that way.
https://networkx.org/nx-guides/content/generators/sudoku.html
Here, to convert the colored graph to a normal one, you'd have a semantic node for the numbers 1-9. You have to do this a lot to encode things into stuff like sat solvers
Anonymous No.105725957 >>105725992
>>105725916
A graph requires a notion of a set in order to be defined in the first place.
Anonymous No.105725992 >>105726023
>>105725957
No you're right, I don't mean this in terms of defining a set, we have ZFST for that, I just mean that you can translate a set into a graph expression that way. If you've ever encoded sets as bit fields, you can think of the bits as the row corresponding to the source node in the adjacency matrix
Anonymous No.105726023 >>105726062 >>105726103
>>105725992
Oh sorry, I misunderstood. So you're basically defining some equivalence between inclusion and connectedness? That's quite a nice trick. Is this some HoTT-adjacent idea?
Anonymous No.105726062 >>105726103
>>105726023
I don't know the proper term for it, the general idea with the manipulation I suggested of adding the semantic node is to encode extra information as nodes themselves in order to articulate more complex properties of the data.
In the sudoku example, you can also encode row/column/cell semantic nodes in order to model each of those as a set, (does this cell have a 9).

It's a weird hack that you can also use to flatten out multigraphs as well
Anonymous No.105726103
>>105726023
>>105726062
I use the term semantic, but you'll also see it described as virtual/fake. I prefer semantic because I think that describes the reason it's there better, it exists to provide information. Structural may also be a good term for it
Anonymous No.105726362 >>105726458
Another good find

https://www.cliki.net/

from

https://cl-foundation.org/
Anonymous No.105726458
>>105726362
Of which is a redesign of:

https://common-lisp.net/
Anonymous No.105726825
>>105719431
Method A is definitely the most readable if the something-* are short. B and C are both unnecessarily bloated. Always go with the simplest and most readable option.
Anonymous No.105726950 >>105727271
>>105718021
>>105718143
>you might as well as using CL
Common Lisp is a worse Lisp than Racket (or any other Scheme). Everyone should learn Lisp with a smaller/simpler implementation first before deciding if they want to move into that craptastic bloatware called Common Lisp.
Saying "you might as well use CL" is like saying "you might as well use C++" when in practice C would work just fine 99% of the time and be a better learning experience to most people.

This is why so many people give up learning Lisp, you idiots keep throwing them into the C++ of Lisp. I'd give up programming too if my first language was C++.

Stop recommending CL to a new learner. It's too much and has too many different ways of doing the exact same thing.
Anonymous No.105727271 >>105728446
>>105726950
CL isn't complicated at all though?
You know you don't have to IMPLEMENT a language to use it right?
The CL reference is simple and easy to read too http://clqr.boundp.org/download.html
Anonymous No.105727985
>>105719431
The clearest way would be something like
let (a, b) = condition (1, 2) (3, 4)
...
where condition is a function that selects the first or second parameter, it looks like C is the closest to that idea
Anonymous No.105728446 >>105729080
>>105727271
>CL isn't complicated at all though?
I wouldn't call a 1000+ page specification "simple". The language is definitely bloated and complicated. It's even larger than COBOL, and twice (I think) as large as modern C++.
>The CL reference is simple
I can create a 50 page booklet on COBOL or C++ too. That doesn't mean those languages and their ecosystems aren't complicated for a new learner.
>you don't have to IMPLEMENT a language to use it
My point isn't about implementing Racket or some other Scheme. It's about showing a new learner of Lisp a simpler dialect with an easier learning curve. Something that doesn't have many different ways of doing the exact same thing in every programming paradigm that has ever existed.

People who are completely new to Lisp would benefit greatly from starting with a simpler dialect. They can always move to CL after becoming more comfortable with Lisp.
Anonymous No.105729080 >>105730406
>>105728446
>specification
That has nothing to do with the language. Are computers impossible for a beginner because they'll have to learn quantum electrodynamics to understand how transistors function?
CL is exactly the same as scheme in use, easier even since there's only one version, there's a package manager, and the emacs integration is better.
Racket by comparison is extremely complex with massive amounts of complicated functions and an entirely separate editor and environment.
Anonymous No.105729223 >>105729258 >>105729420
>>105711980 (OP)
I'm new to lisp. what scheme do you fags use? mit-scheme fucking sucks. it doesn't have reverse search. arrow doesn't even show the last command. are all lisp REPLs like this?
Anonymous No.105729258 >>105729796
>>105729223
>I'm new to lisp.
actually, I shold have said:
>I'm reading the SICP.
Anonymous No.105729420 >>105729513 >>105733875
>>105729223
for guile you have to put stuff in the .guile to make it usable, so maybe you need to do that for mit. But either way mit scheme is a toy education scheme, i would use something more popular like chicken or guile
Anonymous No.105729513
>>105729420
I just installed something called "chezscheme" from the ubuntu repos.
>Chez Scheme Version 9.5
>Copyright 1984-2017 Cisco Systems, Inc.
whatever. al least supports the shit I like in the CLI
Anonymous No.105729796
>>105729258
For SICP, you should use Racket and DrRacket. Not because it's the best scheme (it's too different for other scheme that it's its own language), but because it has SICP mode.
Anonymous No.105730000 >>105730073 >>105730668 >>105730791 >>105731413 >>105731495 >>105734728
Added animations to lem (just for fun). Anyone got ideas for more fun cosmetic/useless stuff to add?
Anonymous No.105730073 >>105730106
>>105730000
https://ash-k.itch.io/textreme
Anonymous No.105730106
>>105730073
Not bad anon
Anonymous No.105730379 >>105730484 >>105734281
I'm finding the sicp explanation of orders of growth frustratingly vague. I have a vague understanding of them from before I started reading sicp but I want to use sicp as an opportunity to get a more precise understanding.

Specifically for its example of recursive fibonacci in 1.2.2 it says "In fact, it is not hard to show that the number of times the procedure will compute (fib 1) or (fib 0) (the number of leaves in the above tree, in general) is precisely Fib(n + 1)."

I can see that this is true but i really have no clue how I would go about proving that.

Then in the next section it says that the order of growth of R(n) is f(n) where k_1 f(n) <= R(n) <= k_2 f(n).

It says that the order of growth of the number of operations for a tree is the number of nodes, and the order of growth of recursive fibonacci is phi^n.

In the last section we proved that Fib(n) = (phi^n - psi^n)/sqrt(5). So I can make an expression for the number of leaves in the recursion, but I don't see how I can relate that to the total amount of nodes. I can also see how I could get the 1/sqrt(5) out of the order of growth expression by putting sqrt(5) in k_1 and k_2, but I don't see how I could get the psi out.

Does anyone have a more detailed write up that actually shows how they did that?
Anonymous No.105730406
>>105729080
This x1000
Anonymous No.105730484
>>105730379
psi is (1 - phi)
Anonymous No.105730491
Modus theme should be the default instead of whatever the current one is.
Anonymous No.105730668 >>105730733 >>105734064
Is it possible to use something like Guile or Babashka to replace makefiles on hobby Cpp projects? Any of you have tried?
>>105730000
Command Pallete?
Anonymous No.105730733 >>105733969
>>105730668
>Command Pallete?
How do you mean? Isn't that basically what M-x is for?
Anonymous No.105730791
>>105730000
Checked.
Anonymous No.105731413 >>105734485
>>105730000
Is the source for your animations available online?
Anonymous No.105731495
>>105730000
Very based quads
Anonymous No.105732133
I found a nice org-mode reference.
https://github.com/fniessen/refcard-org-mode
Anonymous No.105733875
>>105729420
>for guile you have to put stuff in the .guile to make it usable
For me it's
(use-modules
(system repl common)
(ice-9 readline))

(activate-readline)
(repl-default-option-set! 'prompt "> ")
(repl-default-option-set! 'value-history #f)
(repl-default-option-set! 'on-error 'report)
(fluid-set! *repl-stack* (list #t))
Anonymous No.105733969
>>105730733
I mean to make it fancier, with text descriptions (maybe LLM generated) of every available command.
Anonymous No.105734064
>>105730668
>Is it possible to use something like Guile or Babashka to replace makefiles on hobby Cpp projects? Any of you have tried?
I haven't tried but comparing which file was last modified is just
(define (newer? source object)
(let* ((a (open-fdes source O_RDONLY))
(b (open-fdes object O_RDONLY))
(c (> (stat:mtime (stat a)) (stat:mtime (stat b)))))
(close-fdes a)
(close-fdes b)
c))
So if (newer? "main.cpp" "main.o") is #t the build rule for that file is run
Anonymous No.105734281 >>105734320
>>105730379
>I can see that this is true but i really have no clue how I would go about proving that.
by induction
same way you prove 1 + 2 + 3 + ... + n = n(n+1)/2
Anonymous No.105734320 >>105734412
>>105734281
actually it's technically binary induction or double induction: let P(n) be the statement "recursive fibonacci procedure with input n computes fib(0) or fib(1) a total of fib(n) times" then prove P(0), P(1), and the inductive step:
If P(n) and P(n+1) then P(n+2)
this is half way between ordinary induction and full induction
Anonymous No.105734412
>>105734320
that's induction
Anonymous No.105734485
>>105731413
Not yet, I'm going to try merging it upstream at some point though. Not quite ready, though it's usable already.
Anonymous No.105734728 >>105736302
>>105730000
>Anyone got ideas for more fun cosmetic/useless stuff to add?
If lem has the equivalent of *compile* maybe on switching to each error it could have an animated highlight, like the source location of each error fades to red or something
Anonymous No.105735000 >>105736788
>>105713527
>>105715041
same thing
Anonymous No.105735957 >>105736508
>>105725684
since when were you under the impression that i want lisp to get popular? you can go play with the other retarded children writing python
Anonymous No.105736302
>>105734728
I like this idea, thanks anon
Anonymous No.105736508 >>105736552
>>105735957
>uses common lisp
>thinks he isn't a retard
we got a live one here boys
Anonymous No.105736552
we need a common lisp thread at this point to get rid of retards like >>105736508
Anonymous No.105736788 >>105742222
>>105735000
trips of truth
Anonymous No.105737644 >>105738067 >>105742222 >>105779005
Added nine-slice view backgrounds, now we have Final Fantasy Lem. Color scheme sucks but it's fun, I'll add a couple more pleasing ones soon.
Anonymous No.105738067 >>105738150 >>105750973 >>105751042
>>105737644
Nice job anon, another idea is animating the cursor like 4coder so it zips between positions on switching buffers
https://youtu.be/Y-mW1QK5rhU?t=177&mute=1
will have to try lem desu
Anonymous No.105738150
>>105738067
I like this one, better than the neovide version of it that's a little too much. Thanks!
Anonymous No.105738865 >>105738867 >>105741497
CL's pathnames are stupid and insane.
Anonymous No.105738867
>>105738865
what do you mean?
Anonymous No.105738892 >>105739490 >>105743090
Emacs align still is too hard for my sleep deprived brain to understand.
How would one align CLOS classes like so?
Anonymous No.105739490 >>105741442
>>105738892
Doesn't sly do that automatically for you or something
Anonymous No.105740619
>>105725318
>Tile windows
Very neat, anon.
Anonymous No.105741442
>>105739490
It helps with indentation, but it won't do vertical alignment. For that, you might have to run `M-x align-regexp` a few times or do it manually.
Anonymous No.105741497
>>105738865
Nah they are fine, most people just don't understand how they work.
Anonymous No.105742222
>>105736788
Hitler dubs of confirmation
>>105737644
Very niece
Anonymous No.105743026
>>105725318
If you use flymake-mode or flycheck-mode while writing Elisp, Emacs will tell you what you're doing wrong with the docstrings. With that said, here's a few rules you can follow.
- The first line should be a brief summary.
- (Packages like marginalia will display these in a useful way.)
- Keep the width of the docstring within 80 characters.
- If your function has parameters, each parameter should be mentioned in the docstring in ALL CAPS.
- (Xah Lee doesn't like this convention, but it's what everyone does.)
- You can link to things like functions or info nodes by wrapping them in backtick and single quote.
- For example: `use-package' or `(eww) Top'.
- If you use keyword parameters a lot, the docstring for use-package offers a good example of how to format a lot of keyword parameters.
- https://github.com/emacsmirror/emacs/blob/bd04818e53be49f2a087de8a92cb02549f8c2407/lisp/use-package/use-package-core.el#L1835-L1898

Xah Lee's reference for Elisp docs is useful too.
http://xahlee.info/emacs/emacs/inline_doc.html
Anonymous No.105743090 >>105743173
>>105738892
evil-lion is good for this kind of textual alignment.
https://github.com/edkolev/evil-lion
Anonymous No.105743173
>>105743090
emacs already has M-x align, but I think he just can't into regex.
Anonymous No.105744204
Church numerals. Just Church numeral my shit up
Anonymous No.105744669 >>105744888
>https://github.com/nightfly19/cl-arrows/blob/master/arrows.lisp
Apparently I had the same exact idea as this person down to the naming of functions. I guess I will kms?
Anonymous No.105744717 >>105744781
>>105711980 (OP)
>ᵋLisp General
I just noticed the little "ᵋ" before "Lisp".
Anonymous No.105744781
>>105744717
ᵋᵐᵃᶜ ヽ( ˙꒳˙ )ノ
http://xahlee.info/comp/unicode_index.html
Anonymous No.105744845 >>105745969
default c-k is stupid
Anonymous No.105744888
>>105744669
isn't this a common idea?
also I would've thought this should use consp rather than listp for these but idk
Anonymous No.105745822 >>105745946 >>105746062
My personal emacs configuration files have total 68829 line. Is it normal?
Anonymous No.105745946
>>105745822
Wat. Mine used to be ~300 until I switched to lem, where it's like 3 things.
Anonymous No.105745969
>>105744845
why?
Anonymous No.105746062
>>105745822
i'm assuming that's counting your installed packages
Anonymous No.105746187 >>105746255 >>105746314 >>105746601 >>105746718 >>105750147
I want to program an advanced tuner for musical instruments. I'm currently reading SICP. As such, I would like to use Scheme for this. What libraries can I use for reading WAV files, performing fast operations on arrays on floats (at the very least, doing fast fourier transform), listening to audio from the microphone and drawing some plots?
Anonymous No.105746255 >>105746269
>>105746187
>math and i/o
just use the C libraries that do this, specially the real time signal stuff.
Anonymous No.105746269 >>105746439 >>105746540
>>105746255
How do I do that from Scheme? Also, that sounds like a pain in the ass.
Anonymous No.105746314
>>105746187
chez scheme has good C interop. Otherwise just use CL with cffi, tons of good C libraries that you can use for that
Anonymous No.105746439
>>105746269
https://www.gnu.org/software/guile/manual/html_node/Programming-in-C.html
Anonymous No.105746540 >>105746578 >>105747358
>>105746269
>that sounds like a pain in the ass
I think making FFT actually fast (without C libraries) is hard even in more performance-oriented languages than Scheme. Here in the readme dude says that using FFTW via FFI is 10× faster compared to a pure-BQN code:
https://github.com/mlochbaum/bqnoise
I doubt that Scheme can compete with array languages here, so your slowdown will probably be more than 10 times. Though maybe you'll be able to make it just fast enough for your requirements.
Anonymous No.105746578 >>105747893
>>105746540
he could always implement fftgen in Lisp instead of OCaml
Anonymous No.105746601 >>105775127
>>105746187
>music
>scheme
https://github.com/schemedoc/awesome-scheme#graphics-music-audio-video
Also
https://github.com/bintracker/bintracker
Anonymous No.105746718
>>105746187
https://github.com/ul/chez-soundio
https://akkuscm.org/packages/chez-matrices/
https://akkuscm.org/packages/gnuplot-pipe/
Anonymous No.105747358 >>105747893
>>105746540
FFTW is actually a hyper-autistic code generator written in ocaml (that generates C code).
Anonymous No.105747407 >>105747821 >>105747893
My emacs just crashes, no slowdown, no warning. It justs closes. I am using ubuntu and it is self-compiled. How do I start debugging this? I can't tie it to some specific thing, or reproduce it.
Anonymous No.105747821
>>105747407
M-x toggle-debug-on-error if it happens during use
If it's during launch run emacs --debug-init
Also https://elpa.gnu.org/packages/bug-hunter.html
Anonymous No.105747893
>>105746578
>>105747358
TIL. Actually I've seen Oleg Kiselyov's papers about code generation in MetaOCaml via staging, with high-performance libraries as a main use case, but this is the first time I see code generation in real world. Very cool.
>>105747407
Maybe it segfaults or gets OOM-killed? Check the system logs (probably journalctl on ubuntu)
Anonymous No.105748986 >>105749041 >>105749150
What are some tips with org mode styling? I like using it, but at present I have some issues with how flat the color scheme is. I've messed with the heading styles but I still find myself having to kind of squint and it makes me feel old
Anonymous No.105749041 >>105749109
>>105748986
- I like to use olivetti-mode while viewing org documents.
- I also turn on org-indent-mode.
- I also like to make the heading sizes bigger.

;; https://emacs.stackexchange.com/a/75240/37580
(defun my/org-faces ()
"Customize faces for `org-mode`."
(interactive)
(set-face-attribute 'org-document-title nil :height 2.0)
(set-face-attribute 'org-level-1 nil :height 1.4)
(set-face-attribute 'org-level-2 nil :height 1.2))

(use-package org
:ensure nil
:hook ((org-mode . org-indent-mode)
(org-mode . olivetti-mode)
(org-mode . my/org-faces))
;; etc ......
)


I really wanted to like org-modern, but it fucks with indentation and code blocks too much. I know about org-modern-indent, but I could not manage to get things working just right.
Anonymous No.105749109
>>105749041
>org-modern
I actually tried reinstalling it, and ...the bugs I mentioned might have been fixed. Code block indentation looks stable now. ...oh, I'm reading the README... they just disable the fanciness on code blocks if org-indent-mode is on.
Anonymous No.105749150 >>105749182
>>105748986
>I have some issues with how flat the color scheme is
What themes have you tried so far?
Anonymous No.105749182 >>105749683 >>105763494
>>105749150
I'm presently using the doom tokyo night theme, I've looked at a couple of others for org specifically, (can't remember off the top), but I haven't been fully satisfied
Anonymous No.105749683
>>105749182
To my eyes, that's a decent color scheme. Contrast is sufficient and the color choices for org headings harmonize well with each other. In your eyes, is it close to what you want but missing something? If so, you might want to start with this theme as a base and then use set-face-attribute to set your own colors for the parts that aren't satisfying you.

I like going to this site and hitting to get inspiration for color themes sometimes.
https://coolors.co/generate
Anonymous No.105750147 >>105752806
>>105746187
Ok, so far I have implemented reading a WAV file in racket. Fuck me. Scheme is hell on my level of knowledge. Also, chatgpt makes mistakes all the time and is basically useless as a result.

https://pastesio.com/reading-wav-in-racket

Time to go to sleep. Next goals (for tomorrow) - uhh, figure out the fft thing, I guess. Also, maybe plot the wave as a plot.
Anonymous No.105750973 >>105751042
>>105738067
Thanks for the suggestion anon, I went ahead and added the smooth cursor. Might look a bit jaggedy in the webm but it feels smooth. Still a WIP though.
Anonymous No.105751042 >>105751049
>>105750973
>>105738067
Maybe better? If not just take my word for it lol.
Anonymous No.105751049 >>105756086
>>105751042
I'm retarded forgot picrelated.
Anonymous No.105752334 >>105752408
(lambda (f) (lambda (x) (f ((lambda (f) (lambda (x) x)) f) x))
Anonymous No.105752408
>>105752334
//1(00)/1(00)
Anonymous No.105752806 >>105752815
>>105750147
Congratulations.
Anonymous No.105752815
>>105752806
Also this might help:
https://planet.racket-lang.org/package-source/williams/science.plt/4/8/planet-docs/science/fft.html
Anonymous No.105753567
Church numerals are still breaking my brain, but I'm making progress. I've wished once or twice that I came to SICP from at least a passing background in formal lambda calculus rather than coming to lambda calculus through the lens of SICP. Either way, I'll spend as long as I have to here because understanding how closures, lambdas and first-class functions interact in Church numerals seems to be a significant core understanding... if not the singular core understanding.

Not that Church numerals are in and of themselves important, of course. For any real-world application, there's no reason why you need to encode numbers in an enormous sequence of function calls when you could do so with one assembler instruction. It just seems like it's foundational for understanding FP as a paradigm and that you need to breathe these dynamics naturally if you want to do any conceptual work in FP which actually leverages its strengths.
Anonymous No.105753762 >>105754349 >>105791174
Is there an autoformatter for Racket like Black for Python?
Anonymous No.105753800 >>105754349 >>105754376 >>105756862
seems like a lot of guile projects use a really functional programming style. Is there a good scheme resource for learning it or should i just make an excursion to haskell and come back when i understand it
Anonymous No.105754349
>>105753762
parendit
>>105753800
scheme is very functional. There is no way from escaping it.
You don't need to learn haskell to write guile code...
Anonymous No.105754376
>>105753800
>Is there a good scheme resource
My son... you seem like you haven't heard the Good Word yet...
Anonymous No.105756086
>>105751049
Pretty gud
Anonymous No.105756827 >>105757088 >>105757279 >>105757331 >>105757336
>tried to make a personal elisp package that aims at dealing with a big json file
> asked it to Claude
> It generated bullshit elisp codes
> make a Python script by Claude AI
> wrapped it with elisp code
> work perfectly

I think elisp is just suck at dealing json. Ended up feeling like, elisp is for mental masturbating
Anonymous No.105756862
>>105753800
what do you want to understand?
functional programming => everything is a function => everything is a expression.
pure functional programming => everything is a pure function (one argument, no side effect, referential transparency).
Anonymous No.105757088 >>105759987
>>105756827
emacs has native json parsing now. The goyAI has little elisp in its stolen training set, so it can't copy much. It has petabytes of json handling python code.

Good morning sir.
Anonymous No.105757279 >>105759987 >>105763518
>>105756827
"AI" can't write good elisp because it's a predictive statistical model that hasn't been trained on enough elisp code to be able to do so.
"AI" isn't "smart". It can't figure out how to do something if it hasn't seen it done before.
Anonymous No.105757331 >>105759987
>>105756827
Claude is terrible at writing Lisp. All of them are. Deepseek might be the least bad, weirdly enough.
Anonymous No.105757336 >>105759987
>>105756827
slop bots are pathetically bad at anything other than python or webshit languages. and even then you're going to get hacky ugly code that uses entirely made up libraries and methods.
Anonymous No.105759392 >>105759527
https://anonradio.net/
Lispy Gopher Show
Every Wednesday at 00:00 UTC
https://time.is/compare/0000_2_July_2025_in_UTC
I don't know what the topic is going to be this week, but it's going to be in about 26 hours from the time of this posting.

The chat for the show is on LambdaMoo which you have to telnet into to access.
telnet lambda.moo.mud.org 8888
connect Guest

They're going to be hanging out in some Sushi place. To get there, do this when it's close to showtime.
@who

Pick a user that's at the Sushi place, and type:
@join username

Substituting username for the user's name, and it'll teleport you to where that user is.
Anonymous No.105759527
>>105759392
The host:
https://gamerplus.org/@screwlisp
Anonymous No.105759987
>>105757088
>>105757279
>>105757331
>>105757336
It seems like eslip is nearing its end, and there may be fewer new zoomers becoming the emacs chad
Anonymous No.105760777 >>105761388 >>105763158 >>105765142 >>105765510 >>105788263 >>105788746
How to write a simple CLI interface in scheme like

$ scriptname /path/to/input --switch-flag-on --output /path/to/output

?
Anonymous No.105761388 >>105788746
>>105760777
Which scheme?
Anonymous No.105761395 >>105763721
>got used to jetbrains because of work
>happy to be back using emacs again but there's some friction
Main thing I miss from jetbrains is extract method/variable, is there a way to get something similar?
Anonymous No.105762334 >>105763413
>>105725072
>CL trading book
what?
Anonymous No.105763158 >>105780759
>>105760777
Guile has getopt-long.
https://www.gnu.org/software/guile/manual/html_node/getopt_002dlong.html
Anonymous No.105763413 >>105769229
>>105762334
Anonymous No.105763494
>>105749182
Why not look at prot's themes? His ef-themes has a big selection of variants and usually stuff is nicely configured.
Anonymous No.105763518 >>105763538 >>105763744
>>105757279
Aren't they always looking for training data? Most elisp is free stuff, not proprietary, so training it should be easy.
Anonymous No.105763538 >>105763744 >>105763744 >>105765927
>>105763518
I wonder if it might actually be the parens, god knows it's somehow mindfucked a lot of nocoders before, what if there's some sort of actual physical reason for it? Like dyslexia but only for programming in lisp, that also affects AIs?
Anonymous No.105763721
>>105761395
>Main thing I miss from jetbrains is extract method/variable, is there a way to get something similar?
This is up to the language server. Clojure-lsp has lsp-clojure-extract-function.
Anonymous No.105763744 >>105763779
>>105763518
>>105763538
It isn't just the availability of training data, it's up to the creators whether they value Elisp code as high as python etc. Maybe they run more code from popular languages through training more.
Even if they don't, while elisp code is mostly open source there is nowhere near as much of it as for langs like python.

>>105763538
>I wonder if it might actually be the parens,
In the world of AI the parens are just another character to predict.
Anonymous No.105763779 >>105763815
>>105763744
Yeah but a string of repeated characters, which is common and normal in lisps, is in almost all other cases really bad to the point there's lots of specific training to avoid it.
Anonymous No.105763815
>>105763779
>Yeah but a string of repeated characters, which is common and normal in lisps, is in almost all other cases really bad to the point there's lots of specific training to avoid it.
Half of all shitlangs:

}
}
}

Option>();

And there is a temperature setting in the decoding which controls the randomness of output. Maybe they turn this down when they detect code analysis is on the table.
In either case, even "old" decoding methods like nucleus sampling are flexible enough to manage repeated characters if the probability is high enough.
Anonymous No.105765142 >>105786300 >>105788263
>>105760777
(define (parse args)
(match args
[() '()]
[("--switch-flag-on" . rest) (set! flag on) (parse rest)]
[("--output" path . rest) (set! output path) (parse rest)]
[(($ path? path) . rest) (set! input path) (parse rest)]
[(option . rest) (warn 'unknown-option option) (parse rest)]))

;; chez, gambit
(parse (command-line))
;; racket
(parse (current-command-line-arguments))
;; guile
(parse (program-arguments))
;; also guile
#!/usr/local/bin/guile -e main -s
!#
(define (main args)
(parse args))

gambit creates scriptname on compilation which is just a sh/bat file that passes its args to gsi, other schemes often delineate user args with -- so you may want to scan to -- before parsing
Anonymous No.105765510
>>105760777
Guile has a section in the manual doing exactly this.
Anonymous No.105765927 >>105766539
>>105763538
The computer doesn't care about the parens. It's trivial to match them. They're not actually significantly different from languages with curly braces. What filters people arguably isn't the parens at all -- it's just the convention of stacking them at the end of expressions rather than giving every paren block its own newline and indentation.
Anonymous No.105766539 >>105766673 >>105767209
>>105765927
What filters people is the requirement to learn something. People fucking hate having to think.
Ask yourselves what kind of person has been the majority who went into computer science or learned to program in the last decade or so. Exactly.
Lisp encourages you to actually think about programming the act of programming itself which requires thinking a bit more deeply. You'll never get adoption among these people because you struggle to even convince them that even basic linear algebra should be a required topic to learn. They'll cry about learning maths. They'll say "don't reinvent the wheel" not because it's efficient but because they don't understand how the wheels were made and that would require effort that may not reward them with money at the end of it, so why bother? Most people know that the days of Moore's law have been over for decades, but did they then get serious about writing performant code? No. They just stuck their heads in the sand, continued writing shit, probably even worse shit than before, and now we get bloated messes that somehow negates decades of advances in chipmaking. They follow 'best practices' not because it's a good idea but because they're religious codes made to tard-wrangle morons who can be expected to fuck things up. These people realistically shouldn't be coding anything at all. Lisp is ironically probably much simpler than most languages, if anything. People make excuses for them out of politeness but everyone knows the field is dominated by morons.
Anonymous No.105766673
>>105766539
>now we get bloated messes that somehow negates decades of advances in chipmaking
It strikes me almost as an unintentional corollary to the Jevons paradox. Jevons at least had some optimism that not all increased activity from more efficient resources would be wasted -- and if we're being fair here, it's probably still at least roughly true with programming -- but... yeah, it does seem in a general sense that the increases in computing power has been a vehicle for the VC vultures to drop lower and lower quality people into dev roles in pursuit of the almighty bottom dollar.
Anonymous No.105767209
>>105766539
Both ocaml people and lisp people have shown that for "learning programming" it doesn't really matter if you are C-like, lisp or ML-like. There are some talks about janestreet folks teaching non-technical workers and they did fine with ocaml.
Anonymous No.105769229
>>105763413
/g/reat book
https://files.catbox.moe/f6d04n.pdf
Anonymous No.105769797 >>105770758 >>105770781 >>105772247 >>105775496 >>105775638
I trust you guys more than /dpt/.
What're your rules of thumb for using macros in C?
My personal line is when I start putting control flow operations in them or generate function signatures and the like. I don't think using macros to achieve metaprogramming is a good thing
Anonymous No.105770455
I love lisp so much it's unreal
Anonymous No.105770758 >>105770781
>>105769797
>What're your rules of thumb for using macros in C?
1) don't
Anonymous No.105770781
>>105769797
>generate function signatures and the like
Should use C++ (or some newer and better language) at this point
>>105770758
this
Anonymous No.105772247
>>105769797
What are you writing in C?
...And are you using Emacs to write it?
Anonymous No.105773639 >>105782305
Interesting
https://clojure.org/news/2025/06/27/deref
>eca - Editor Code Assistant (ECA) - AI pair programming capabilities in any editor (https://github.com/editor-code-assistant/eca)
Anonymous No.105774655
I don't believe Clojure is the future of Lisp
Anonymous No.105774818 >>105775127 >>105784293
If someone here wants to start with chicken scheme:

A Introduction to CHICKEN Scheme (installation, usage, libraries, documentation)
https://www.youtube.com/watch?v=aIwt7ocBBdo
Anonymous No.105775127
>>105774818
nice video anon
>>105746601
>https://github.com/bintracker/bintracker
nice chickenware
Anonymous No.105775251 >>105776772
All accumulators must die. All accumulators are bastards. Drop kick accumulator babies into trash compactors.
Anonymous No.105775496
>>105769797
#define profile ... /* to print __LINE__ */
#define CASE(item, type) ... /* to permit refactoring later */
switch (t) { CASE('.', DOT) ... }
#undef CASE
#define lerp(a, b, t) _Generic ...
// perhaps controversially
#define range (a, b, c) for (int a = b; a < c; ++a)
Anonymous No.105775638
>>105769797
>What're your rules of thumb for using macros in C?
My rule is to ignore most of these rules of thumb and think about whether it actually works and whether the code is better off for having them or not.
Anonymous No.105776770 >>105777727
>>105711980 (OP)
I wish I was this cute.
Anonymous No.105776772
>>105775251
The compiler should just rewrite expressions that generate stack temporaries to an accumulator where it identifies them
Anonymous No.105777727
>>105776770
you are
Anonymous No.105778142 >>105809534
Why is clojure tooling so shit? If I don't use it consistently I forget the CLI/deps.edn format and ALWAYS take hours setting up a new project
Anonymous No.105778387 >>105778432
A while back some people were saying the CL metaobject protocol was like wizardry. Can someone give some examples of this? I can only find the trivial ones like counting instances of a class.
Anonymous No.105778432 >>105778451 >>105778493
>>105778387
Well you modify the object system itself so it really is whatever you want. I'll give you an example. I'm not using this yet but I made a prototype that worked.
I'm making a game, so something I'd like to optimize for is consing. I have a few ways to get around it, like pooling or using SBCL arenas. So as a test I made a MOP metaclass that automatically creates an array per class, and transparently pools it behind the scenes. The usage looks the same as any normal class, but in the background when you make a new one it reuses already allocated memory instead of allocating anew.
Anonymous No.105778451 >>105779005
>>105778432
This sounds cool, and I do understand the concept, but I'm really wondering if anyone has a specific code example that they think is a cool use of MOP.
Anonymous No.105778493 >>105779005
>>105778432
are you that g*rman who makes CL games by any chance
Anonymous No.105779005
>>105778493
No, I'm this anon >>105737644
>>105778451
I see
Anonymous No.105780759
>>105763158
>https://www.gnu.org/software/guile/manual/html_node/getopt_002dlong.html
nice
Anonymous No.105782305
>>105773639
looks good
https://github.com/editor-code-assistant/eca-emacs
Anonymous No.105783207
>decide to look into doxygen highlighting minor mode
>don't actually use doxygen, but the comment style is familiar
>look online
>doxymacs is the #1 rec but it's 16 years old
>try https://github.com/Lindydancer/highlight-doxygen
>works alright
>accidentally type something it interprets as a code block
>c-ts-mode starts repeatedly activating and deactivating every keystroke
>emacs slows to a crawl
>debug
>read some of the documentation for the package
>test configs
>finally scroll down to this
>>https://github.com/Lindydancer/highlight-doxygen/blob/eec4874e2e89d4eb39091aad89a67dff8f8ec84c/highlight-doxygen.el#L373
>for the code block formatting that I don't even want, it's repeatedly creating synthetic buffers and applying the mode, then 'copying' the formatting into the real buffer
>it's slow as shit

I'm at a loss
Anonymous No.105783912 >>105784091
I just had an idea, imagine a variation of interactive, specifically for functions that insert text, where instead of typing in the minibuff, it displays what it will generate as you type
Anonymous No.105784091 >>105784105
>>105783912
I've seen evil do something like this already during regexp search and replace.
:'<,'>s/pattern/replacement/

As you type pattern and replacement, you see the speculative changes happen in the buffer. I don't know how evil does this though. You still type in the minibuffer in this case though.
Anonymous No.105784105
>>105784091
>You still type in the minibuffer in this case though.
Yeah, probably would keep that for sanity's sake.
I was just using the org insert link feature, and I was thinking about how having visual feedback would be nice. I also have buffer macro for c structs where being able to see it would help me.
Anonymous No.105784293
>>105774818
I wanna try many of these langs but my work requires me to interact with Windowze so i stick with Python for necessity and Bash whenever i feel i can
>Captcha:KYSMSS
Anonymous No.105784929 >>105784957 >>105785906 >>105786136
SLIME or SLY?
Anonymous No.105784957 >>105785204
>>105784929
You won't notice a difference when starting out, Sly is a fork of SLIME so it's the same thing with a couple different minor features. Use Sly if you want ASCII art in your prompt basically.
Anonymous No.105785204 >>105785212
>>105784957
>SLY's highlights are:
>A full-featured REPL based on Emacs's comint.el
doesn't that make a difference? i ended up going with SLY because i'm accustomed to other comint based modes like M-x shell
Anonymous No.105785212
>>105785204
Yea but a lot of the history navigation stuff is just handled manually by SLIME with the same keybinds, it feels almost the same to me.
Anonymous No.105785245 >>105791056
>>105712867
What's that tattoo on her leg? Down by her ankle.
Anonymous No.105785906
>>105784929
I picked sly. because it seems slightly more maintained.
Anonymous No.105786136 >>105787453
>>105784929
SLY maintainer is a douchebag.
No I won't motivate. Stick around for long enough and you'll see.
Anonymous No.105786300 >>105786834 >>105788263
>>105765142
I don't get how this part
[(($ path? path) . rest) (set! input path) (parse rest)]

Is supposed to work, there doesn't seem to be any path? type or function in any implementation of scheme I can find.
Anonymous No.105786834 >>105787937
>>105786300
It's not a function. It's a pattern for match to work with.
https://www.gnu.org/software/guile/manual/html_node/Pattern-Matching.html
Search for "a record" on that page to see what $ is for.
Anonymous No.105787453
>>105786136
same guy that maintains eglot? lmao, explains a lot of things. Average portuguese
Anonymous No.105787937 >>105787960
>>105786834
I did, there's no record path?, it doesn't work.
After more searching it only exists in racket, there's nothing like it in other schemes, not even as a module.
Anonymous No.105787960 >>105787965
>>105787937
match is what you need to understand.
Anonymous No.105787965
>>105787960
You're not reading my posts, I get match, I know what the $ means.
I'm saying there's no such thing as "path?"
Anonymous No.105788263 >>105788640
>>105786300
>I don't get how this part ($ path? path) Is supposed to work
I messed up it's a typo, the pattern should be (? path? path) where path? could be (in guile at least)

(define (path? path)
(and (file-exists? path)
(eq? (stat:type (stat path)) 'regular)))

In anon's original input >>105760777
>$ scriptname /path/to/input --switch-flag-on --output /path/to/output
they want to match 3 common cases: (--switch), (--switch option), and (path). path is tricky as it could be positional, optional, or overridden by later paths. The function >>105765142 handles the latter case so the final pattern can report any failed matches (which is nearly certain, most command line lists start with the name of the program), instead of raising these questions with anon I tried to do the least annoying thing and let them fix it
Anonymous No.105788640 >>105788746
>>105788263
just use optparse in guile ffs.
every fucking day schemers are reinventing the damn square wheel.
Anonymous No.105788672 >>105789056
this monad stuff doesn't make any sense
Anonymous No.105788746
>>105788640
The first reply to >>105760777 was >>105761388 which has stackoverflow vibes, we don't know which scheme anon is using (and Shinn's match is well ported) so I just posted a small transparent function as an example of parsing args
Anonymous No.105788776 >>105788806 >>105789024 >>105790999
Weird question but
do you guys do any lisp programming in android? if so, what do you use? emacs on android? cl-repl? or plain termux?
Anonymous No.105788806
>>105788776
I use Emacs on android to write Emacs Lisp. Yes.
Anonymous No.105789024
>>105788776
Lem worked on termux for me
Anonymous No.105789056
>>105788672
It's just a monoid in the category of endofunctors, what's the problem?
Anonymous No.105789945 >>105790178
Added a little asset preview, had something like this in Emacs a while back but it was janky. I don't know if I'll keep it as part of the frontend or make it a contrib but I find it useful for gamedev/webdev.
Anonymous No.105790006 >>105790014 >>105790149 >>105790649
Why are sbcl backtraces so fucking unreadable?
Anonymous No.105790014 >>105790649
>>105790006
wtf I find SBCL incredible for debugging, literally my favourite compiler to work through issues with
Anonymous No.105790149
>>105790006
It's pretty shouty, but I've only found disable-debugger and not any settings for controlling verbosity
Anonymous No.105790178 >>105790186
>>105789945
That's pretty cool, like the embedded asset previews in templeos
Anonymous No.105790186 >>105790257
>>105790178
That's not what inspired me or anything..
Anonymous No.105790257
>>105790186
Your secret is safe with me anon
Anonymous No.105790649
>>105790006
>>105790014
He's kinda right, you need to adapt a bit and learn what to look for, there is a lot of noise there that is not very interesting.
Anonymous No.105790999
>>105788776
You can try picolisp:
https://picolisp.com/wiki/?PilBox
Anonymous No.105791056
>>105785245
BGC (big gnu cock) ownership branding
Anonymous No.105791174
>>105753762
raco pkg install --auto fmt
中出し No.105793314
>>105712364
>https://github.com/nmeum/edward
Ed, man! !man ed
https://www.gnu.org/fun/jokes/ed-msg.html
Anonymous No.105793429
>>105712364
>2.4mb of tests
Anonymous No.105795074 >>105797554
I've been using emacs for 5 years but I don't get the appeal of org mode. I just don't use it. Just memorize it with your brain bro
Anonymous No.105796197
gonna try out GNU Hyperbole. wish me luck
Anonymous No.105797554 >>105797897 >>105800333
>>105795074
Do you get the appeal of markdown? Org-mode has a lot in common with it.
Anonymous No.105797897
>>105797554
>Do you get the appeal of markdown

No
Anonymous No.105799062 >>105799159 >>105799480
If I learn Clojure, does that knowledge transfer to Elisp?

Also, what are your go-to projects when learning a new language?
Anonymous No.105799137 >>105802562 >>105806157 >>105808370
Hello is Dylan worth messing with or just a pointless diversion?
Anonymous No.105799159
>>105799062
>Also, what are your go-to projects when learning a new language?
a small database-backed web site
Anonymous No.105799480 >>105799559 >>105801378
>>105799062
I don't have go-to projects in a new language, I prefer to just do something that feels right for them. It should be something with a serious challenge and something I haven't done before.
Question for the thread btw, can people tell me why they like Clojure? I like the sequence abstraction but I really feel like many changes make it a weaker language than Common Lisp and I'm not sure why I'd want to use it. I want to understand what people love about it.
Anonymous No.105799559
>>105799480
I'm too much of a javelet to even know how to build and deploy a clojure project. Literally got filtered by deps.edn.
Anonymous No.105800333 >>105800567 >>105803224
>>105797554
My life is simple enough that I don't care about optimizing stuff, and as a wagie I must balance myself between been to productive and people start asking me for stuff and being fired. I use orgmode at but only its basic functionalities and to generate integrated reports with org-babel's sql mode.
Anonymous No.105800567
>>105800333
wagie dub trips
Anonymous No.105801378 >>105801450
I want to write a tiny GUI application (basically an input field, two radio buttons and logic to detect where is yt-dlp in your $PATH). Is ClojureDart overkill for this? Should i just make a Swing application and compile it with Graal?
>>105799480
Dunno about mainline Clojure, but Babashka is very easy to deploy on Windoze, not using Powershell is worth the slight bloat.
Anonymous No.105801450
>>105801378
>I want to write a tiny GUI application
I feel like Racket would be good for this. It has a decent cross-platform GUI library in its standard lib.
https://docs.racket-lang.org/gui/
https://github.com/mfelleisen/7GUI
https://alex-hhh.github.io/2021/09/screenshots.html
Anonymous No.105801852 >>105801859 >>105802595
I'm a very lazy person with ADHD.
Is learning emacs mostly for org-mode worth it ?
Anonymous No.105801859 >>105801881
>>105801852
If you're lazy with adhd what do you want org mode for
Anonymous No.105801881 >>105801884
>>105801859
idk dude, be more organized i guess ?
Anonymous No.105801884
>>105801881
give it a week and see if it's for you, i'm not a note-a-holic just just regular markdown-mode does the trick for me
Anonymous No.105802562
>>105799137
very cool lang, you can also look up rhombus-lang
Anonymous No.105802595
>>105801852
yes, you can compile org mode to many different formats (or even html)
Anonymous No.105803224
>>105800333
I started using org mode because it was markdown but more geared toward notes/lists, as well as the emacs compatibility
I'd been using a mix of markdown and latex for most of my text documents for a while depending on the complexity.
Org files are extremely easy to write for the most part even without emacs, so there's little complexity
t. Barely use the fancy features of org
Anonymous No.105804653
http://anggtwu.net/index.html#eev
Anonymous No.105806157
>>105799137
OpenDylan?
Anonymous No.105806328 >>105806816 >>105806990
do you use avy-goto-char or avy-goto-char-2
Anonymous No.105806816
>>105806328
evil-avy-goto-char-timer
Anonymous No.105806990
>>105806328
1 gives too many results, so 2.
Anonymous No.105807123 >>105807331
Why can't it get rid of the vim keybinding?
(define-key evil-normal-state-map (kbd "gg") nil)
Anonymous No.105807331 >>105813985
>>105807123
`C-h k g g` says:

g g runs the command evil-goto-first-line (found in
evil-motion-state-map), which is an interactive native-comp-function
in ‘evil-commands.el’.

It's in evil-motion-state-map. I'm curious why you want to disable this binding.
Anonymous No.105808293 >>105808442 >>105811322
I feel bad for just becoming aware of justfiles. I love them for writing project-specific tasks, and they're well supported in Emacs.
https://github.com/casey/just
https://github.com/leon-barrett/just-mode.el
https://github.com/leon-barrett/just-ts-mode.el
https://github.com/psibi/justl.el (not evil friendly yet)
Anonymous No.105808370
>>105799137
overly verbose and the object model seems to be a total clusterfuck.
Anonymous No.105808442 >>105808467
>>105808293
I was considering using Babashka's tasks for the same niche. Wonder which one is better.
Anonymous No.105808467 >>105808481
>>105808442
If you're mostly running shell commands (which is what I'm doing), just is a better fit. Just also has a polyglot mode that lets you write and run scripts fragments in another language, so you can mix just with babashka if you want.
https://github.com/casey/just?tab=readme-ov-file#shebang-recipes
Anonymous No.105808481
>>105808467
I like "just" as a word, too. It feels emphatic (and good).
Anonymous No.105809534
>>105778142
Looks like Janet might be the answer if JVM FFI isn't necessary.
Anonymous No.105810016 >>105811828
spent a few hours fucking around trying to replicate bash scripts using guile.
It's uh, not easy to do process control.
Like I couldn't even figure out how to do it and had to resort to running parallel in bash inside scheme.

Is the only way to figure out the fork commands and manually track all the pids and control them with unix signals? Is there nothing better than that? I thought I could use threads for a while but it just doesn't work when I have to make system calls.
Anonymous No.105810401 >>105810462 >>105811540
not really a lisp question but im using neovim for scheme and using blink.cmp for completion, the full name of the functions using symbols such as ! or ? dont show up, anyone know of a fix for this?
Anonymous No.105810462
>>105810401
>anyone know of a fix for this?
yeah use emacs
Anonymous No.105810899 >>105810938 >>105811540
Has anyone ever used TAGFILES for scheme?
Xref-find-definition and find-references don't work for me. The file was generated with etag myfile.scm
Anonymous No.105810938
>>105810899
scheme was made to be used in a repl only, it's an educational programming language.
Anonymous No.105811322
>>105808293
Before finding just, I was using ondir to load and unload shell functions. I am happy to be able to deprecate that workflow, because I changed shells recently from zsh to nushell, and ondir doesn't work in nushell. However, just will work fine, and it's simpler.
https://github.com/alecthomas/ondir
Anonymous No.105811540 >>105811784
>>105810401
Try extending ALPHANUMERIC with ?! in https://github.com/Saghen/blink.cmp/blob/main/lua/blink/cmp/completion/accept/prefix.lua it'll be something like that, if lua has string literals grep ?! for special handling in stuff like ternary operators in other languages

>>105810899
>The etags program handles more than 20 languages, including Emacs Lisp, Common Lisp, Scheme, C, C++, Ada, Fortran, Java, LaTeX, Pascal, Perl, Python, Texinfo, makefiles, and most assemblers. The program has no switches for specifying the language; it recognizes the language in an input file according to its file name and contents.
It's apparently supported by emac, does find-tag like https://ftp.gnu.org/old-gnu/Manuals/emacs-lisp-intro/html_node/etags.html describes at least work?
Anonymous No.105811784 >>105811909
>>105811540
the tag file is generated correctly. it seems xref just shits the bed.
Anonymous No.105811828
>>105810016
chibi-scheme has nice (chibi shell) module. I haven't used it, but tests definitely look better than pipeline and other guile bullshit:
https://github.com/ashinn/chibi-scheme/blob/master/lib/chibi/shell-test.sld
Docs: https://synthcode.com/scheme/chibi/lib/chibi/shell.html
You may find it more bearable.
Anonymous No.105811909 >>105812596
>>105811784
https://github.com/emacs-mirror/emacs/commits/master/lisp/progmodes/xref.el
I can't see anything sussy in recent commits but you could try dropping in an older version of xref.el (this would be a good feature for emac to have for regression testing)
Anonymous No.105812362 >>105818139
PSA: NEWCOMERS: there's a maintained fork at sharplispers/lparallel
https://github.com/lmj/lparallel/issues/51
Anonymous No.105812596
>>105811909
try creating a scheme file in a separate folder.
Define a main function, some other bullshit.
Run etags.
Try M-? on one of them.
Anonymous No.105812769 >>105813880 >>105816713
C-x 8 e e s c r
Anonymous No.105813831 >>105816739
I've started using the scratch buffer for scripting really minor shit I need in the moment, it's quite lovely
Anonymous No.105813880 >>105815401 >>105815676
>>105812769
what the heck
I've been using emacs for 5 years, but I didn't know such shits

and I was like
>Who the fuck use this shits?

I would get rid of it
Anonymous No.105813985
>>105807331
I want to get rid of it cuz I find 'go' better
Anonymous No.105815401 >>105816109
>>105813880
It's a recent addition, 29.1 according to NEWS. I prefer C-x 8 RET for inserting emojis.
Anonymous No.105815676 >>105816109
>>105813880
>I would get rid of it
why? facilitating the input of text is an essential goal of emacs. see the venerable MULE and its countless input-methods
Anonymous No.105816109
>>105815401
thanks

>>105815676
sorry for my harsh words.... :) (I'm asshole) I know many ways to type emojis, so it's kind of redundant for me, and it's hard to memorize.
Anonymous No.105816713
>>105812769
Not the most ergonomic binding...
Anonymous No.105816739
>>105813831
I wrote a nice function in the *scratch* buffer the other day, but I forgot to save it in a file, and I had to rewrite it today. Thankfully, it wasn't that long, and the second time around went faster.
Anonymous No.105817264 >>105817300 >>105817706
Why does this work in Elisp? I thought you had to use funcall.
((lambda () (+ 1 2)))
Anonymous No.105817300
>>105817264
You're making a function which requires no arguments and will just evaluate (+ 1 2). The function is then applied to nil, so it evaluates to 3.
Anonymous No.105817706 >>105817979
>>105817264
Lisp-2 only affects symbol binding. Lambda returns a function directly.
Anonymous No.105817754
I finally got multiprocessing working in guile. it's kindof a pain but not really that complicated once you figure out how exactly to do it.
Lots of extremely perplexing and frightening errors involved, makes debugging very difficult and scary. I almost forkbombed myself a few times and completely broke a dozen terminals making interactive debugging effectively impossible.
Also some of the function dexcriptsion are INSANE shit like "input a non zero number to KILL ALL PROCESSES ON THE COMPUTER"
Why the fuck would I want to do that exactly? Hell why the fuck CAN I do that with a single command?

Put simply all you have to do is (primitive-fork), use a conditional to determine which process is the child and have it execlp sh sh -c, and then waitpid WAIT_ANY to get the result asynchronously.
In it's finished form it's only a few lines, but man was it an experience getting there.
Anonymous No.105817979
>>105817706
TIL. Thank you.
Anonymous No.105818139
>>105812362
non-ironically used it (the old one) in a script at my day job.
Anonymous No.105818412 >>105819370
I'm using WSL2 on Windows but want to try out emacs (or maybe lem). Should I run it in my linux VM or on Windows?
Anonymous No.105819370
>>105818412
from what i've heard, running emacs natively on windows is notoriously slow. not sure if they have fixed that
Anonymous No.105819967
new bread
>>105819961
>>105819961
>>105819961
>>105819961