Lisp Machinesโข Edition!
>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 Resourceshttps://gnu.org/s/emacs
https://github.com/emacs-tw/awesome-emacs
https://github.com/systemcrafters/crafted-emacs
>Learning EmacsC-h t (Interactive Tutorial)
https://emacs.amodernist.com
https://systemcrafters.net/emacs-from-scratch
http://xahlee.info/emacs
https://emacs.tv
>Emacs Distroshttps://spacemacs.org
https://doomemacs.org
>ElispDocs: 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 Lisphttps://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
>Schemehttps://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
>Clojurehttps://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
>Otherhttps://github.com/dundalek/awesome-lisp-languages
>Guixhttps://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/HtDPhttps://web.mit.edu/6.001/6.037/sicp.pdf
https://htdp.org
>More Lisp Resourceshttps://rentry.org/lispresources
(setf *prev-bread*
>>105581689)
Symbolicsโข or LMI?
https://www.youtube.com/watch?v=sV7C6Ezl35A
3640
md5: 53aff4021e992a927002e78f3710aaea
๐
For me it's Interlisp
https://online.interlisp.org
Neat.
https://www.lisppad.app
Is there a more elegant way of doing this?
(define (for-each-break fn lst)
;; fn must accept two arguments
(call/cc
(lambda (break)
(for-each (lambda (item)
(fn item break))
lst))))
I don't like having fn taking 2 arguments.
>>105647435>What was hard about it? I literally just changed c-mode to c-ts-mode in my config.One of the main things I wanted was to have function calls be highlighted in the same color as function definitions/declarations. I don't know if this is changed, but the documentation for treesitter at least when I last monkeyed with it was very inconvenient to find.
Something else I've wanted to do is be able to use ctags to track macro definitions as opposed to function definitions and highlight them appropriately, but I gave up.
>>105651172>Emacs written in Forth when?Here you go: https://github.com/larsbrinkhoff/fmacs
This line deserves mention:
https://github.com/larsbrinkhoff/fmacs/blob/master/src/text.fth#L12
>>105652963You can pass it implicitly by breaking hygiene with syntax-case macro (like anaphoric macros in CL). Of course, there will be issues of scoping (if you make two nested loops, you can break only from the inner one).
Real men only program in C
Okay guys, I think I'll try dabbling into The Little Typer to better understand low-level Coq aspects. Hopefully 400 pages will worth it.
What's the best way to use racket (specifically one of its languages) in Emacs? racket-mode? Just plain vanilla scheme-mode? geiser? LSP?
>>105652614 (OP)How would I go about implementing arbitrary combinations of car and cdr? Like I want to be able to write caddaaddadddaaddddr, and it'll automatically expand to
(car (cdr (cdr (car (car (cdr (cdr (car ....
Possible to do without a reader macro?
>>105652734>PARC aestheticthey stole it from Douglas Engelbart.
clj
md5: 6628ee974ca482714b728439661e336f
๐
>>105655187Clojure, indeed.
>>105655187what is more impressive, a retard nesting for loops and deferencing null pointers or a literate mastering design patterns and functional applications?
>>105655313i mean the former is concrete but total failure, the latter is buzzwords and faffery to shave yaks. they both fail.
SICP
md5: d5d5a164a3dca83ca6e0415b8b0dfe86
๐
>>105655187>Dennis Ritchie: I have to admire languages like Lisp (http://www.gotw.ca/publications/c_family_interview.htm)Based & LISPilled Dennis Ritchie
>>105652963>Is there a more elegant way of doing this? I don't like having fn taking 2 arguments.Adding an implicit parameter like that sounds like a monad, (guix monads) might have something, other alternatives are cons-stream (where take acts as break) or fn returning thunks that for-each evaluates
>>105652963>How would I go about implementing arbitrary combinations of car and cdr? Like I want to be able to write caddaaddadddaaddddr, Possible to do without a reader macro?(symbol-name 'caddaaddadddaaddddr), then traverse the string emitting car/cdr in a macro until r
>>105655438>symbol-nameoh shit. i guess a reader macro is inevitable if i wanted to invoke it as a normal function with normal syntax. thanks anon
>>105655355it's only a buzzword to the PLT illiterate.
>>105655536If you don't mind autocomplete stalling on caddaaddadddaadddd you could just generate them all
(loop for ca/dr in (all-permutations-of-ca/dr) do
(make-cudder ca/dr))
helix
md5: 5405ff213e67f79fbd6f40948f4c8c83
๐
Helix + Steel lookin' promising
https://github.com/helix-editor/helix/pull/8675#issuecomment-2982160168
>>105655617I use GhostText with Emacs a lot. It's good to hear that Helix just got this too.
https://github.com/alpha22jp/atomic-chrome
https://github.com/fregante/GhostText
>>105655278You're insane for actually wanting that, it's a much better idea to just make a function/macro that takes a list/string argument to do that like clojure does.
However, if you just want to do it for fun you'd need a reader macro since there'd be no way to actually call your macro without some kind of initial identification. You could do it with a prefix, but just plain text is impossible.
At best you could just write a macro to define every possible variation as a function.
>>105656528>You're insane for actually wanting thatThere are some crazy people in computing.
>>105655187You stole that from what people said about FORTRAN. C programmers have no creativity or originality, just like their language.
A couple of threads ago there was a small discussion of Linear Lisp.
This approach seems to have similar asymptotics but the internals are different:
https://github.com/dkopko/klox
>>105652832Funfact: Apple uses TinyScheme for sandboxing!
>Sandbox policies are written in a dialect of Scheme known as SBPL. The policies are interpreted via an interpreter within libsandbox, based on TinyScheme, which generates a compiled representation of the policy that it passes to the Sandbox kernel extension.https://bdash.net.nz/posts/sandboxing-on-macos/
Also emac keybindings too!
>These standard bindings include a large number of Emacs-compatible control key bindings, all the various arrow key bindings, bindings for making field editors and some keyboard UI work, and backstop bindings for many function keys.https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html
Is verbosity a good thing here?
I'm seriously considering writing a LISP compiler to C now and I wonder if ~a ^ b should be (^ (~ a) b) or (binary-xor (binary-not a) b)
>>105657747>C programmers have no creativity or originality, just like their language.And?
>>105659867>I'm seriously considering writing a LISP compiler to C nowI just finished something similar by coincidence
I don't think it really matters and would depend a lot on what the big picture of your approach is.
>>105659954Because I'm trying to improve things, not make them shittier.
>>105659969Writing C code in LISP syntax.
>>105659973>Writing C code in LISP syntax.Yeah but that's not really sufficient for a complete description. For example, is this going to just generate a string automatically, or does it go through an intermediate representation first, do you analyse the IR to optimise the code, etc.
>>105659982Writing C code in LISP syntax. Why would I optimize when C compilers exist? It's just C, with different syntax, code will be identical.
>>105659991If you can't even describe your idea of how the "compiler" is going to work, then how do you expect your question to be answered, much less make any sense?
A compiler by definition outputs a different language, I know that. You posted the question and now you're being a brick wall when I'm trying to actually help with an answer.
>>105660020I don't need to, because it's self evident, sorry but I don't get paid to educate special needs.
>>105659991how would that even work? sexprs are the polar opposite of C syntax.
if i can't do insane bullshit like duff's device it's not C, simple as
>>105660086(switch
; implementation left as an exercise for the reader
)
>>105660033You aren't "seriously considering" writing a compiler. You have a vague notion of something that seems to you like a compiler.
If you can't describe how it will work, then what you're doing is simple string output, and there is absolutely no point whatsoever with examples like
>>105659867 because the answer is nobody will bother. They'll write it in C.
If you have a "serious" idea to write a compiler, then you need to non-trivially manipulate the code. Which means you need some idea of a strategy and then you might have some idea like using a macro to manipulate binary operations in some way, in which case the latter example is better. But since you can't describe any actual steps of what it is you want to do while insisting you've got it all figured out, the answer is, it doesn't matter, and you should just write C because this whole project is pointless and can be trivially done in a day or two by an undergrad, because it's not worth actually doing. That's fine though, because you clearly don't actually have a serious idea of what to do.
>>105660106I'm not going to read your niggerbabble, go check a dictionary definition of compiler and report back once you edificate yourself, because I don't get paid to.
>>105660116Yeah if you're this stuck up about answering simple questions about how any of this will be executed you're not gonna make it.
It's no skin off my back, I've actually done what you're about to fail at, so have fun lashing out when people just ask a basic question so they can help you. I'm sure you'll go far.
>>105660139I already told you that my compiler would target C, if you don't know what this means, then you have nothing to tell me that I didn't already know.
https://writewithharper.com/docs/integrations/emacs
A new spell checker just dropped.
>>105660382strange that they use eglot as an example considering it still doesn't support multiplexing, so you won't be able to use this on anything other than pure writing modes
>>105660153You have no implementation plan. There's nothing to talk about. It's completely trivial.
>>105660100that's not a description of how you'll make it work, and you seem pretty reluctant to actually describe any details
if you're just writing functions which don't actually do anything other than pretty printing C then there's not really any challenge
>>105660753won't need one either, because I just got reminded
>>105660787It's obvious how it would work. Which is why the only question I had was about syntax and not implementation, your worthless input wasn't asked for by anybody.
Please go to /ancsg/ - annoying no coder schizo general
LISP (Lots of Isolated Silly Parentheses)
( > ' ' )>
>>105656528> you are insane for actually wanting thatYou are a poser. No Lisp programmer would ever say something like that.
(define (parse-char char)
;; matches single character
(lambda (input)
(if (and input
(> (string-length input) 0)
(char=? char (string-ref input 0)))
(list `(CHAR ,char) (string-drop input 1))
#f)))
(define (parse-any-char)
;; matches any char
(lambda (input)
(if (and input
(> (string-length input) 0)
(char? (string-ref input 0)))
(list `(CHAR ,(string-ref input 0)) (string-drop input 1))
#f)))
(define (parse-string str)
;; matches string str of #f
(lambda (input)
(if input
(let ((input-len (string-length input))
(str-len (string-length str)))
(if (and
(>= input-len str-len)
(string-prefix? str input))
(list `(STRING ,str) (string-drop input str-len))
#f))
#f)))
(define (parse-or lst)
;; return the first matching parser result or #f
(lambda (input)
(if (and input lst)
(or-map (lambda (parser) (parser input))) lst)))
(define (parse-sequence lst)
;; matches all parsers in sequence or #f
(lambda (input)
(if (and input lst)
(let loop ((acc '())
(str input)
(parsers lst))
(if (null? parsers)
(list (reverse acc) str)
(let ((result ((car parsers) str)))
(if result
(loop (cons (car result) acc ) (cadr result) (cdr parsers))
#f)))))))
Which dialect should I start with? Here's what I want:
> minimal to no "standard"
> the programmer creates problem-specific vocabulary (or syntax) by extending the language to solve the problem
> advance metaprogramming capabilities both at the macro level and the introspection/analysis
dogma
md5: 59a9497da97f4606eda394bca9f6a1e4
๐
>>105662235> picrel> the programmer creates problem-specific vocabularyWhat if the things in picrel are the best way to tackle a problem? This retardation is the reason nobody uses lisp.
>>105660382>using LSP for a spell checkerextremely grim
>>105662263- You'll get used to managing state inside tail-recursive functions.
- A younger me would have balked at this.
- However, for a long-lived server, it leads to a very solid system.
- You can still have state, but state changes are managed very deliberately this way.
>>105662046>common lisp (and clojure) has big standard >scheme has shit macro system Emacs Lisp is your best bet. Saved for its text editing and manipulating functions, you have very little library to use.
>>105662448Emacs Lisp is probably the best Lisp to start with, because it's going to keep you inside Emacs which is the gateway drug to every other Lisp.
>>105662440Again, I am more interested in problem-oriented programming. I want Lisp to act as a baseline, on which I can "explore" the problem as freely as possible. Globals/States are really good when you are solving a problem.
>>105662448I don't care about macro "that" much. Is scheme good?
>>105662505Scheme is good. R5RS spec, pick an implementation, and off you go.
>I am more interested in problem-oriented programming.
>Is scheme good?
lol
>>105659367>much of the implementation and resulting behavior are shared with Apple's other platforms (iOS, iPadOS, tvOS, etc)This makes TinyScheme the most widespread and widely used Lisp.
Schemechads we won.
>>105662046Why would you want this type of autism, you sound like a CL programmer before you even touched a lisp. This is very concerning Anon.
pharo
md5: 3c82fda538f4b21bf470cb948beae4d5
๐
It's just as good as lisp. It IS!
>>105662875Actors are inferior to functional programming when the goal is not async programming.
>>105652614 (OP)let syaro out!!!
XAH TRVTHNVKE just dropped on the HN frontpage
https://news.ycombinator.com/item?id=44310996
>>105662046https://picolisp.com/
>>105662884actors and smalltalk objects are not the same thing. The actor model is a whole computing model and an alternative to the turing machine or lambda calculus.
>>105663321>>Lisp is not, nor has it ever been, a functional programming language.HNigger deboonked by John McCarthy
>LISP has a partially justified reputation of being more based on theory than most computer languages, presumably stemming from its FUNCTIONAL form, its use of lambda notation and basing the interpreter on a universal function.>As a programming language, LISP is characterized by the following ideas:>5. Composition of functions as a tool for forming more complex functions.>6. The use of conditional expressions for getting branching into function definitions.>7. The recursive use of conditional expressions as a sufficient tool for building computable functions.>8. The use of ฮป-expressions for naming functions.>12. The LISP function eval that serves both as a formal definition of the language and as an interpreter.https://www-formal.stanford.edu/jmc/lisp20th.pdf
>>105663321I don't really agree with all of this but Clojure does implement this in a very nice way. Even if I think CL remains better overall.
>>105663321That "gisp" argument is literally the most retarded thing I have ever read.
>>105663431i remember McCarthy saying that he only took the ฮป syntax from church and nothing more because he couldn't understand ฮปcalculus.
>start emacs after a few months
>doom emacs install broke and won't initialize properly
?????????????????????
>>105663321>> Lisp (as well as Prolog, Haskell, ML, etc.) programmers won't be persuaded to abandon cons cells or lists as they find them extremely useful.>Who said anything about abandoning lists? The argument appears to be that lists don't need to be built up out of two-element cells (i.e cons cells), and that Lisp, by enforcing `cons` cells as a way to construct lists, is seeing some limitations.>DESU, I agree a little that that PoV - there is no need for exposing the implementation of the list to the programmer, much less forcing the programmer into using the implementation.>The other problem with enforcing lists to be constructed of cons cells is one of performance; the default list in Lisp is a cache-invalidating monster.I wholeheartedly agree with this. There's no need to expose the implementation of the list as cons cells like most Lisp dialects do. It would be much more elegant and more performant if the implementation details were abstracted away from the user, allowing Lisp to use a more efficient representation of a list internally.
Cons cells worked well back in the 60s when CPUs didn't have caches. Accessing an array sequentially wasn't that much faster than pointer chasing back then. Nowadays a cons cell in a cache-invalidating performance-destroying monster.
Not trolling, but what are the applications of LISP machines in 2025?
>>105664567The reason this argument always falls flat is that cons cells, and lists by extension AREN'T LISTS AT ALL! They're TREES!
Any replacement to cons cells is going to need to be a flexible branching data structure, which basically means indirection anyway.
Yes in theory you can transparently implement all this with arrays, but it's not quite a straight forward as it's implied to be and not as massive of a performance win.
The biggest issue is that lispers like making their own custom data structures(probably because they're not enough of them implemented in the standard) and cons cells are ideal for that, they're not very efficient but extremely flexible and easy to use. Any possible replacement is going to have to lose that flexibility and simplicity to function properly.
And this doesn't even touch on the fact that LISP HAS ARRAYS! They're right there, you can use them anytime you want more performance! Removing cons cells for no reason just to force people to use arrays against their will is retarded. I'll use lists and dynamic typing as much as I want, and if it's too slow I can type hint everything and use fixed size arrays. Why is this a bad thing?
>>105663321>>105664567>Everything in Lisp is beautifully elegant and uniformly abstracted away>Except the exposed low-level implementation details of the cons cellsIt's surprising it too this long for someone to mention that design flaw.
>LISt Processing
>it's not about lists
smartest HN poster
>>105664803The argument isn't that we need to replace cons cells, but that we don't need to expose the implementation to the user.
That is completely correct. It's inelegant. It's an implementation detail. The user doesn't need to know that lists are implemented as cons cells. The user also shouldn't be mutating the underlying cells directly without going through a uniform collection interface like the one Clojure has.
The point is that this allows the compiler/interpreter to optimize the code into an array, or some other structure, if there's nothing in there that requires the usage of cons cells. Exposing the implementation means the compiler can't use anything other than cons cells EVERYWHERE, which is pretty awful for performance.
Also...
>and lists by extension AREN'T LISTS AT ALL! They're TREES!It's not called Trep. it's called Lisp, for Lisp Processor. The whole language is based around the concept of LISTS, not trees.
You can represent trees with cons cells, but only because the implementation details are exposed and can be abused by the user to create linked list-based trees.
As mentioned above, that's not a good thing, the implementation details should be abstracted away from the user to prevent this type of abuse that makes optimization harder than it needs to be.
>>105664924Not that anon, but how can you have that kind of optimization while still allowing lisp to evaluate itself.
I mean, maybe at the moment there is no code that does anything fancy to the list so you can optimize it as an array. But lisp allows the user to later define a function that might destroy that assumption, and then what happens, does the compiler have to automatically remake the array into a normal list?
>>105664924Optimization is pointless 99% of the time, all that matters is being able to do what you want as simply as possible, cons cells are that.
You still have no argument about arrays already existing, and people not using them because they prefer cons cells.
>we HAVE TO hide this away from the programmer>he can't be trusted with control of the code!Insane ramblings of a psychotic. What's next, removing structs because they can be turned into cons cells? No more memory allocation, it all has to be declared at compile time? Cant do recursion anymore, think of the stack size! What's that you want to use arbitrary precision? Sorry, that's an anti-pattern, everything is now a 32 bit integer fixnum.
>>105665057>Optimization is pointless 99% of the time>Hiding implementation details is badLet me guess, you're unemployed?
>>105652832now I can channel my autism on my old iPhone
>>105665081Let me guess, you're indian?
The only reason to hide things from the programmer and focus on "compiler optimization" is because your programmers suck and are impossible to educate and you're desperately trying to salvage their shit code by offloading all of it to compiler devs instead.
>>105664803>They're TREES!the abstract types list and tree have a different interface. for example, a list has only one tail, a tree has multiple leafs/nodes/children. no offense dude, but i had to learn that during the first semester of cs.
>>105665048>But lisp allows the user to later define a function that might destroy that assumptionThis isn't an inherent feature of the Lisp-family that every dialect has to support. It's only a feature of SOME dialects.
In that case you've cornered yourself into requiring a linked list representation of source code to allow for runtime mutation, that should be considered a design flaw.
Statically compiled Lisps don't have to adhere to this limitation. Clojure can be compiled into JVM bytecode just fine without requiring all the source code to be represented as cons cells. GOAL could compiled into PS2 machine code without such limitation as well.
>>105652832Anything similar for android?
>>105664803lists are just unary trees :^)
really tho these discussions are always pointless because they always boil down to "lisp would be better if it wasn't lisp"
>>105665281>"lisp would be better if it wasn't lisp"Actually, Lisp would be better if it was mostly Scheme (R6RS) with some Clojure (no cons cells).
>>105665143>to allow for runtime mutation, that should be considered a design flaw.Maybe from the point of view of wanting an extremely performant low level lisp language. But not every program needs extreme performance, and having runtime mutation is more of a _feature_ in many cases.
I think it would be best to try and have both. Disabling the possibility of runtime mutation should itself be considered an optimization. And it's up to the programmer to use it or not.
>>105659867If you don't mind non-ascii chars, using the modern/old logic symbols for boolean/binary operators respectively frees up ^ for exponentiation like
(match node
((^ a b) (emit "pow(a, b)")))
WHY WON'T CIDER PROMPT ME FOR A FUCKING SHADOW-CLJS BUILD LIKE THE DOCS SAY?? AHHHHHHHHHH
>>105665930BECAUSE I NEED TO SET THE DEFAULT REPL TO shadow-select
AHHHHHHHHHHHHHHHH
>>105665940BUT THAT DOESN'T START A WATCH AUTOMATICALLY
AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
>>105665930>SHADOW-CLJSSuch is the way of the dark arts
>>105666028WHAT THE FUCK DOES THIS MEAN
The required namespace "snabbdom" is not available, it was required by "dumdom/core.cljs".
IM SEETHING RN
>>105666060snabbdom wasn't in scope when dumdom looked for it, presumably because it's either missing or been renamed
ebin
md5: 053e61fe569f2b4e2184e7233927384c
๐
>>105666060>snabbdom dumdom
in scheme, is using values instead of a list to return multiple values more performant than building/passing lists around?
Does anyone recognize the font used in the endatabas demo video?
https://www.youtube.com/watch?v=oDHGjUMqPvI
https://www.endatabas.com/
what's lisp general's opinion on Haskell?
>>105666962https://coalton-lang.github.io/
>>105667008I want to give this a try, but I'm not sure what kind of project it would be good for.
>>105662046Have you taken a look at Janet?
https://janet-lang.org/ (Janet Website)
https://janet-lang.org/docs/index.html (Official Janet Docs)
https://janetdocs.com/ (User Contributed Janet Docs)
https://janet.guide/ (Janet for Mortals Book)
https://janet.zulipchat.com/ (Janet Zulip Chat)
I just added an entry for them in:
https://rentry.org/lispresources#janet-lisp1
>>105667335Tangent: Can you believe rentry's monthly costs? $5K/month sounds way too high when catbox.moe gets by on $1490/month.
where can I buy a lisp machine?
>elisp for configuring Emacs
>CL for FFI/performance sensitive & systems applications
>Clojure(Script) for everything else
simple as
>Wanna fall for the babashka shilling i've read these last months
>Needs to install Maven and some JDK shitware to install decent database bindings
Not sure how to feel about that, if it's worth without using any external dependency. Binary is on the bloat-ish side.
>>105666322Depending on the implementation.
I love you guys. I hope the world lets me sit quietly and write Lisp. I don't want to fight another war.
What's a good dark theme for emacs that's not too black, I prefer maybe a very dark blue or something instead.
>>105668300adwaita maybe
>>105668231yeah i haven't heard from one of my former (Iranian) colleagues and good friends at all since last week, pretty sure his family is trapped there right now
can't tell you how antisemitic i feel right now desu
> Emacs is getting slower every release.
> M-x org-mode takes ~5 seconds
> Download a 5 year old version
> it's lightning fast
What gives?
>>105668767works on my machine.
>>105668777> works on my machineInvalid argument. I have a 10 year old machine for playing classic windows games. And the editor is actively getting slower every release. You can prove it yourself if you actually "benchmark" two different version of emacs and actually compare the cycle count.
It is wasting important CPU cycles that should be used on code that is written by user to extend emacs.
>>105668805Just for comparison, Visual studio 6.0 can compile the entire Jagged Alliance 2 source code and execute it, while emacs is still initializing org-mode.
>>105668767>>105668805>>105668808Is this with emacs -Q? I just ran
>emacs -Q>M-x eval-expression>(benchmark 1 (org-mode))And it was like 0.000001s or something insignificant like that, and my pc is 7 years old.
>>105668824That's printing out some other internal clock time. Let me share a webm.
>>105668824Could this be Window's Defender scanning every single generated file?
>>105668880Nope, it still stalls. Disabling defender does nothing.
1
md5: ecfe0a7ce6258b767cf83c619906bbbe
๐
Disorganized guy here. If you don't recall I wrote my note-taking app in ClojureDart.
I'll give you guys lifetime premium if you want to try it.
Download the Disorganized app (android/ios), register a proper account, go to settings -> copy user id, then send it to me an email at support AT getdisorganized.com and I'll give you lifetime premium. And if you give feedback I'll give you premium for two lifetimes.
THANKS FOR READING THIS AD.
>>105668880>>105668890Aha, windows user. I've heard of performance issues with Windows before and that's probably what's going wrong. Sorry man, I'm not sure there's a officially certified solution to this, maybe you can find tips and tricks online to speed up the windows build.
I also couldn't tell you what changed between new builds and old, beyond that it's not like this on Linux.
>>105668899sent :^)
thanks
>>105668980Damn, already my first qt jap user. 4chan is incredible.
>tfw Lisp never got me a crumb of pussy
maybe I should've picked Clojure
>>1056688991. Fdroid
2. Accrescent
3. XMR payments for premium
>>105669076you have just insulted the entire korean peoples, apologize and acknowledge that dokdo is korean
>>105669155I will consider all feedback except this guy's.
>>105669157Clearly my racism needs work, I will go apologize in /pol/
In my chase to make the computational implementation of the Wallis method (via an SICP problem) as simple as possible, I derived a completely tortured and ridiculously opaque permutation of the Wallis thing. It's fucking stupid and completely worthless, but I had fun and it appears to be novel by virtue of obscurity.
(define (pi-est n)
(let ((scalar (/ (sqrt (+ (* 4 n) 8))
(+ (* 2 n) 3))))
(square (* scalar
(product (lambda (x) (+ 1 (/ 1 (+ (* 2 x) 3))))
0
(lambda (x) (+ 1 x))
n)))))
(define (product term a next b)
(if (> a b)
1
(* (term a)
(product term (next a) next b))))
Picrel is an informal outline of the math behind it. Sorry for the handwriting, I'm a lefty
>>105669666this is extremely unlikely to be novel since by shifting indices and some simple manipulation you should recover the standard expression
>>105669679It's not novel in any significant way. Its novelty (if extant; not attached to that in any way) is purely in its obtusity. I couldn't find any other record of a solution which utilizes this scalar, but there have been literal decades of people working through SICP so it's more likely that no one had the shamelessness to record it.
>>105668300>What's a good dark theme for emacs that's not too black, I prefer maybe a very dark blue or something instead.https://github.com/catppuccin/emacs
>>105669696the point is that it is equivalent to the typical Wallis product and therefore it has been recorded centuries ago
>>105667837Java of all things probably has all the database drivers in existence.
>>105670743CL is definitely lacking in this area. It's got the major open source ones covered, but if you're trying to use anything obscure, you're on your own.
>>105670758Le what? We have some weird fukamachi package, postmodern, CL-SQL (dead and rotten) and what else?
The only half-decent one is postmodern.
>>105666322>in scheme, is using values instead of a list to return multiple values more performant than building/passing lists around?* (define (f x y) (values x y))
* (define (g x y) (list x y))
* ,x f
Disassembly of #<procedure f (x y)> at #x2313030:
0 (instrument-entry 54)
2 (assert-nargs-ee/locals 3 0) ;; 3 slots (2 args)
3 (mov 2 1)
4 (mov 1 0)
5 (reset-frame 2) ;; 2 slots
6 (handle-interrupts)
7 (return-values)
* ,x g
Disassembly of #<procedure g (x y)> at #x23146f8:
0 (instrument-entry 60)
2 (assert-nargs-ee/locals 3 1) ;; 4 slots (2 args)
3 (make-immediate 3 772) ;; ()
4 (allocate-words/immediate 0 2)
5 (scm-set!/immediate 0 0 1)
6 (scm-set!/immediate 0 1 3)
7 (allocate-words/immediate 3 2)
8 (scm-set!/immediate 3 0 2)
9 (scm-set!/immediate 3 1 0)
10 (reset-frame 1) ;; 1 slot
11 (handle-interrupts)
12 (return-values)
At least in guile it looks like f just shuffles its arguments while g allocates, both functions use return-values (guile uses a simple template-jit for native code gen, so shorter bytecode should correspond to fewer instructions)
>>105668890i use org mode on portable emacs on my work pc, for me it's unusably slow because everything syncs though onedrive, even though it's set to always be kept on my computer
>>105670743This babashka crap was supposed to come with a kitchen sink built-in cause is a self contained binary. I wasn't expecting to need to install Java shitware for aditional dependencies. Might as well write Clojure. Guess it's time for Racket.
>>105670795Well at least CL has bindings for other programming languages.
>>105671011> more performantYou are in lisp bro. The only thing you should be thinking about is algorithmic performance, anything below that is violating Lisp restrictions.
>>105670795The fukamachi stuff worked OK in my experience. It could use a little more documentation, but considering he isn't a native English speaker, I cut him a little slack.
The fukamachi database stack is:
cl-dbi - database driver abstraction
sxql - query DSL
mito - ORM
https://github.com/fukamachi/mito
>>105671371Depending on the implementation you can increase performance by orders of magnitude by doing stuff like that.
Specially with the "numerical tower" which is not very good for performance. Numerical type checking (with a simple if) can show the compiler that it will never have to do certain stuff for example.
>>105671320You need to either implement the 'wire' protocol used by your flavor of DB or get it from somewhere else.
>>105671371>You are in lisp bro. The only thing you should be thinking about is algorithmic performance, anything below that is violating Lisp restrictions.If you have an hour to spare, you have to see what's possible. People are sleeping on what sbcl is capable of.
https://x.com/killian_arts/status/1925029797438333420
>>105671385> Depending on the implementationImplementation details are hidden for a reason anon. When it matters, you are supposed to roll your own implementation.
So essentially you write the entire program without worrying about implementation details. And then you either roll your own lisp, or modify the source code of the interpreter to allow "fast returning of multiple values".
>>105671417That's exactly my point. You are "not" supposed to "care" about "implementation performance" when programming in Lisp. You focus on the problem and the algorithmic performance. And when the program is finished, you can either switch to a different interpreter or roll your own that is specific to your problem.
>>105666962>what's lisp general's opinion on Haskell?I've never given Haskell a proper try, but I'm willing to try Coalton.
>>105666962Practical Programming Language:
>C/C++Enlightened Equivalent of Programming
> Lisp and ForthGarbage
> Haskell,Java, every other programming language
>>105671427>>105671443>This Stack Overflow post points out an obscure and undocumented weakness in Intelโs implementation of the POPCNT instruction [...] GCC, clang and MSVC all fail to take this issue into account.>Until a new patched version of my favourite C compiler is released, there arenโt many workarounds for this performance bug. Iโd have to switch to inline asm [...]>SBCL easily supports this use case, without having to re-release or even recompile the implementation: VOPs (virtual operations) execute arbitrary CL code during code generation and they can be defined at runtime.>The first step is to make sure that SBCLโs assembler knows how to emit popcnt: the assembler can also be extended at runtime [...] We define VOPs via define-vop, a macro that exposes many options.https://pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-in-sbcl/
https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/
From memory this is how cl-simd added simd intrinsics for vectors and matrices, it's just a library that extends the assembler with new instructions
>>105670847>Gruber DarkerIt has a few problems that need fixing.
https://github.com/rexim/gruber-darker-theme
>>105671583What's the point?
I wrote C/C++ professionally at my day job. And it's common knowledge, to "not" trust the compiler. Compiler's can't even do basic things like inlining reliably. In C/C++ you are supposed to ignore the "instruction" level details and instead focus on memory, caches, accessing schemes, etc. Then you actually benchmark your code, and then you start looking at assembly.
I can guarantee you that every single AAA game that uses an in house engine, has inline assembly "hacks" to deal with stupid compiler bugs.
And you should never compare Lisp with C, never. Any performance gained by a lisp interpreter at instruction level does not matter if you are using a general purpose off the shelf interpreter. It's such a stupid way to phrase an argument.
>>105671625It's a emacs 24 scheme, which is fine for me since I don't use newer emacs releases.
>>105671640>I don't use newer emacs releases.I'm at a point where I require 29+, because I love the --init-directory option so much. I also really appreciate native compilation for Elisp (which came in 28 but it keeps improving with every major release).
May I ask what version you're on, and why you chose to stay at that version?
>>105671631>What's the point?It permits the code generator to be extended as an isa is extended, so users don't have to wait for a new release to take advantage of new hardware
>>105671706> It permits the code generator to be extendedWait so I can actually change the code generator within the language itself? Now that sounds interesting.
>>105671817Sure, the first link in
>>105671583 writes about adding new instrinics, or for a real world implementation: https://github.com/marcoheisig/sb-simd/blob/master/code/instruction-sets/avx2.lisp
>>105671677> May I ask what version you're on?I just install the oldest version supported on a specific platform. So any v26+ release is fine for me.
> Why you chose to stay at that version?I want my text editor to be invisible. I just have a single init.el file, that is guaranteed to work everywhere. Also, I don't trust open source developers. Case in point, indenting a 2000+ line source file takes an eternity to complete, macros take even longer. Guess what, the entire editor is bottlenecked by language modes. Just switching to fundamental or text-mode and then applying a macro, gives you a 50x speed up. It's insane how bad the developers are. However, I switch back to an older release and its works fine.
And I actually reached out to the developers to report the issue. Their response was:
>It's reasonable to lag when applying a complex macro across an entire file
>>105671993>Case in point, indenting a 2000+ line source file takes an eternity to complete, macros take even longer. Guess what, the entire editor is bottlenecked by language modes. Just switching to fundamental or text-mode and then applying a macro, gives you a 50x speed up.nta but I've also experienced that, I think it's because stuff like buffer text properties and highlighting are applied with regexes
>>105672077Even if we ignore that. I can compile entire programs and execute them within a second, we have games that run at 240FPS, and these people still can't process a file within a second let alone milliseconds.
>>105671427this is language wankery like the C schizo.
Squeezing performance relies on stuff like this.
knowing what wastes GC time, what uses heap space etc is important.
>>105672148Yep, it's pretty wild, it can likely be refactored to run normally without breaking compatibility but it would require a deepdive into emac buffer internals which is beyond me
>>105672157> knowing what wastes GC time, what uses heap space etc is important.Not in lisp. I have never seen a enterprise Lisp product that actually pushes the hardware enough for that to matter.
Lisp machines seem like a retarded idea honestly. Why would you prefer it over a general purpose computer?
>>105673018>Why would you prefer it over a general purpose computer?Nobody does.
>>105673018they made a lot more sense back when computers were so slow that specialized hardware made more sense. now the industry uses languages that are so slow that lisp is reasonably fast in comparison
>>105673018Lisp machines are a general purpose computer. They supported more programming languages than Unix and DOS did.
>>105673060>>105673076That's enough 4chan for today.
>>105668880>>105668890unironically install WSL2 and set up emacs in that, it will be very snappy. the native wangblows version of emacs has always been dogshit.
i can't remember why cause it's been a problem since forever but it's pretty much never gonna be fixed
I have an irrational fear of Dired. I worry that if I do something slightly wrong, I'll delete an entire folder. I have the wastebasket thing enabled, but I still don't know how safe it is to be a fool in Dired. What safeguards are in place?
>>105666962I prefer OCaml for practical programming and Coq for messing with cool type stuff (though I'm still relatively inexperienced there).
>>105673623You should have backups. And test them regularly.
>>105673640I do have backups, but I'm obviously only opening Emacs for things that I'm working on right now. My PC isn't a fucking SQL database. I'm not running backups every minute.
why is it that I don't miss types in Lisp? Every time I try to program in a dynamically typed language I just desist and go back to something with static types, but with lisp it just makes sense somehow
>>105673670You don't write Enterprise Software (tm) in Lisp.
>>105673643I mean, losing several hours of work is usually not a huge problem, often you can recreate it in 30 minutes (unless it's something very tedious and not intellectual).
By default Dired asks you on file deletion, showing a file or a list of files that are affected, and forces you to type full yes/no answer. I prefer just y/n and still can't remember deleting anything by mistake.
>>105673670The only really good thing about static types is that you can make compilers scream by changing the type of something while you're refactoring. This makes those refactorings easier.
>>105673670I have the exact same experience. Not sure exactly what does it. Clojure is just good because it's always a map, number, string, vector, or nil. And it's pretty rare that I mix them up. And nils tend to fall through naturally.
>>105673670>>105673860the moment you work with other shitters that don't follow the guidelines or write schemas (or god forbid, write wrong schemas without testing and end up breaking CI on every other project that depends on it) this falls apart
t. clojure job
i hate being a wagie so much it's unreal
>>105673623I've been using Dired regularly for like two years and I've never deleted anything "by accident". It literally asks you to confirm every time you try to delete something, so I don't understand your fear at all.
I made this script for helping with window and buffer management, it's the first meaningful attempt I've made at writing elisp, and I was hoping to get some feedback, as I'm still learning and this was a lot of trial and error.
It:
- Allows you to do a depth first search of the windows and splits
- Linearize a buffer list with optional dupe checking
- destroy your current windows and have them reopen either horizontally or vertically
- cycle the current windows forward or backward 1
- swap the current buffer with another
Honestly I'm happy with how it feels to use, but I wouldn't mind some appropriate flaming of my lisp.
Script is too long for post:
https://pastebin.com/nsmmvTat
Something else I want to add is a fan function that allows you to specify a number of windows per row and column, and it'll mosaic them
>>105666823Looks like OCR-A
file
md5: 9da99319bb39aa1931035dfb78c3f5cc
๐
>>105655231Okay, racket-mode is good enough so far. Pie's type inference is annoyingly weak. Also, it's weird with currying: both ((fst 5) 7) and (fst 5 7) in picrel work fine, but adding dummy parens like ((((fst) 5)) 7) doesn't work, even though IMO supporting that would be more consistent.
>>105674998racket mode or geiser. Geiser feels like getting a kick in the nuts after you use sly/slime, but its what schemers got.
>https://github.com/opencog
giant hyperautistic scheme project. Why is it unknown?
>>105671485>Practical Programming Language for hackers to exploit>>C/C++>Enlightened Equivalent of Programming>> Lisp and Forth>Garbage collection made useful>> Haskell,Java, every other programming language
>>10566632values should be faster since they are only passed to the outer expression, unlike a list which is a full object being tracked by the garbage collector.
file
md5: c87ddfeea927ab2f0d5b8fc3a2093fe3
๐
>>105674834>OCR-Asimilar but not quite
https://fonts.adobe.com/fonts/ocr-a
>>105674817Quick comments: If you're going to use :keyword arguments a lot, I'd look into cl-defun.
;; https://www.gnu.org/software/emacs/manual/html_node/cl/Argument-Lists.html
(info "(cl) Argument Lists")
It'll give you an &key that'll do the plist-get calls for you.
It otherwise looks like it was written by an experienced programmer even if Elisp is still relatively new to you. It's good to see docstrings on every function. One little thing you might not know is that there's a way to quote symbols in docstrings such that they become clickable when viewed via `C-h f`.
(defun my/print-window-tree ()
"Prints the window tree layout using `my/descend-window-tree'."
(interactive)
)
Notice how `my/descent-window-tree' is wrapped in a backtick ` and a single quote '. Emacs will try to turn that into a clickable link when viewed via the help system. I wanted to link to the docs for this quoting notation, but I couldn't find it. I was hoping it was somehwere under here.
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation.html
(info "(elisp) Documentation")
>>105674817Run M-x checkdoc on your code and fix it.
>>105676344>>105676403Thanks guys, I appreciate the input, I admittedly got lazy on the docs, the checkdocs thing is kinda spooky, I wish this was more common in other languages.
>>105676425Emacs and Elisp documentation culture, while not perfect, is pretty strong. There are a lot of conventions in place that are worth learning and following. It's not just the core but the whole ecosystem is pretty thoroughly documented, and I've come to really appreciate that.
>>105676472Nah that's actually really nice, I doubt it would hurt me as well as I learn to be meticulous. Most of my functional programming experience has been with typed ocaml, and type systems are a solid guardrail.
>>105674817I just gave my/fan-windows-x and my/fan-windows-y a try, and they both worked perfectly. I've wanted functions like this in the past, but it's not easy to write so I never got around to doing it myself. Very nice work.
>>105676552Thanks!
Just FYI, the swap buffers one is a little goofy if you have the same buffer in multiple windows, I haven't figured out the specifics of why, but it can feel a bit random
>>105676557My goto solution for swapping windows is
https://melpa.org/#/ace-window
M-x ace-window
and then hit ? to see the one letter commands. If you already know them by heart, just type your command.
M-x ace-window command number
M-x ace-window number
I also have ace-window bound to M-o as recommended. If you play with it for a little, you'll get it.
>>105667837>wants the extra bells and whistles of a proper programming language in a stripped down easy to deploy hosted environment>complains about having to pull dependencies the stripped down hosted environment obviously doesn't bother to bundleYou're asking too much to a fancier bash with better defaults, i don't even like Clojure but dunno what did you expect. It's exactly the same shit with every other programming language. Even Python, the poster child only supports SQlite in any useful fashion by default, the rest needs more robust modules. Do you think AWK is shit because it doesn't come with taylib bindings or something retarded like that? Do you think nu-shell or fish come with the ability to query databases OOB as language features? Go bitch to GraalVM's issue tracker for spitting crap binaries if you care this much about muh bloated size.
>>105671417You don't even need the JVM to run (most) libraries with Babashka, Maven is just a piece of shit that can't be self-hosted and also the only option you have to download Clojure dependencies in general. Everything uses it under the hood.
>>105677355>Do you think AWK is shit because it doesn't come with taylib bindings or something retarded like that?AWK is shit no matter what it comes with or doesn't come with.
>>105671394Meant this
>>105677355>>105677363It's nice to script some tasks inside an Alpine container
I got the tiling version of the window thing working but good fucking god it took too long.
I had to prototype this in python to even articulate what needed to happen and that took longer than I'd have liked. You can see my sanity slowly erode as well as me try the cl- stuff through this.
>inb4 docs
tomorrow, plz, otherwise by all means let me know where I fucked up
https://pastebin.com/rgMtnRhd
>>105659367>SBPL (Sandbox Profile Language)Interesting ( ห๊ณห )
https://8ksec.io/reading-ios-sandbox-profiles/
Lisp DSLs for HTML are the best, because they can use kebab-case which maps directly to HTML attributes that are also in kebab-case. In languages that don't use kebab-case, their DSLs are in a tough spot and end up looking ugly or weird.
I wish mixing languages were easier.
I'm struggling on picrel. What I have is as such:
(define (cont-frac n d k)
(define (inv x) (/ 1 x))
(if (= k 1)
(n k)
(* (n (- k 1))
(inv (+ (d (- k 1))
(cont-frac n d (- k 1)))))))
Which... works. But it's omitting the final, terminating d.k at the end. I'm trying to implement this procedure precisely as directed, with no inner helper functions or inherited state. I'm trying to direct it entirely with control flow alone, in other words -- just raw computational, structural direction where control flow is a function of the shape of the problem rather than anything explicit (other than the unavoidable base case).
The problem here is that the final term, n.k / d.k, is the final term in the mathematical sequence but by necessity the not the base case because under these constraints I can't create an iterator variable or otherwise alter the function signature. Is it possible to insert this final term in front while maintaining my current constraints?
The iterative implementation is trivial, I know, but I'm trying to do it all by the book. Not looking for an answer or solution, just some food for thought.
>>105680700Wait... is it really as simple as
(if (= k 1)
(/ (n k) (d k)???
That really doesn't match my mental model of where the program is going
>>105680822No, it isn't. Sorry, not gonna clog up the thread with more self-responses. Just needed to self-correct.
>>105680700Isn't your index kind of going backwards? Meaning that your most deeply nested fraction is k=1 instead of the max value.
>>105680846Yeah, that's a constraint of sticking with the given signature. It's the crux of the difficulty (maybe impossibility) of solving the problem the way I'm trying to. If I could follow the shape of the sequence itself, it would probably be trivial. But given a literal interpretation of the problem as formulated, the shape of the computation has to be the inverse of the shape of the problem.
>>105652734I'd love to use it if I could actually do anything with it lol. No quicklisp last time I checked and I couldn't figure out how to interact with the host os filesystem.
>>105662046Why do you care about there being a standard? Just use cl anon
>>105675335>https://github.com/opencogAGI written in Scheme? Beautiful.
>>105681026Well sure, but I'm not talking about the implementation, I'm talking about the result.
For example, if you write out the equation your function is producing, say for k=4, it would look like this: N3/(D3+N2/(D2+N1/(D1+N1))), which is totally backwards.
Not sure how to fix it using your constraints though. But I'm just pointing out that your problem is more than just the last term.
>>105683270Played a bit with atomspace in 2021. Nowdays I think that this is mostly just schizo crap.
>>105683507reading the atomspace readme makes me want to ask the dev irl what i would actually use it for. either i would learn something new or laugh my ass off
Adds typechecking in your path
(use-modules (ice-9 match))
(define (lookup symbol table)
(cdr (assoc symbol table)))
(define-syntax check
(syntax-rules ()
[(_ program)
(test 'program '())]))
(define (test term table)
(match term
[('let (bind value) body)
(test body (cons (cons bind (test value table)) table))]
[('lambda (bind ': type) body)
(list type '-> (test body (cons (cons bind type) table)))]
[(f x)
(match (list (lookup f table) (test x table))
[((a '-> b) c)
(if (eq? a c)
b
(begin (format #t "type mismatch: ((~a -> ~a) ~a)~%" a b c) #f))])]
[('+ x y)
(match (list (test x table) (test y table))
[('Int 'Int) 'Int]
[('Real 'Real) 'Real]
[(a b) (format #t "type error: (+ ~a ~a)~%" a b) #f])]
[(? boolean?) 'Bool]
[(and (? number?) (? exact?)) 'Int]
[(and (? number?) (? inexact?)) 'Real]
[symbol (lookup symbol table)]))
(check 1) ;=> Int
(check (+ 1 #t)) ;=> type error: (+ Int Bool)
(check (+ 1.0 2.0)) ;=> Real
(check (lambda (x : Int) x)) ;=> (Int -> Int)
(check
(let (id (lambda (x : Int) x))
(id 2.0)))
;=> type mismatch: ((Int -> Int) Real)
(check
(let (x 1)
(let (y 2)
(let (double (lambda (x : Int) (+ x x)))
(+ x (double y))))))
;=> Int
>>105683999now make @ a reader macro and add that as a decorator.
>>105683999You may enjoy this paper:
http://www.ccs.neu.edu/home/stchang/pubs/ckg-popl2017.pdf
Their typechecker is implemented via racket macros (macroexpanding into code without type annotations and producing an error if ill-typed) and they implement different typesystem features up to System Fฯ.
>>105682010>Good:https://github.com/ruricolist/spinneret
https://github.com/skyizwhite/hsx
For CL, I think these two are the best HTML DSLs. If I were doing more webdev in CL, I'd use one of these, because the code you write with them looks so nice.
>Bad:https://github.com/JuliaWeb/Hyperscript.jl
I was a little bummed last night thinking there might not be anything better in Julia for HTML DSLs. The really unfortunate thing about Hyperscript.jl is that any attributes have to be passed in at the end following Julia's keyword passing conventions. That's normally not a problem, but for HTML, it looks weird and backwards. For example, Look at where the id="a" is in the code versus where it's rendered.
julia> div(div("bar"; id="b", hxMethod="PUT"); id="a")
<div id="a"><div hx-method="PUT" id="b">bar</div></div>
To me, this is intolerable. I looked for others, but I just kept finding libraries that forced me to write ugly things.
>More Bad:https://github.com/JunoLab/Hiccup.jl
Hiccup in Clojure is alright, but in Julia, the code you have to write is not pretty.
>Maybe Good:https://michaelhatherly.github.io/HypertextTemplates.jl/stable/
Fortunately, I just found something that I might find tolerable, but it's very obscure. On the bright side, it has seen some development in 2025 and looks maintained which is good. This is the first DSL for HTML in Julia that I've found that I don't think is ugly.
>>105684915so many html generators but CL has little HTML parsers and other web dev tools.
>>105684942On the topic of parsers, the org-mode parser situation in CL is not good.
- There are two libraries with the exact same name written by two different people.
- https://github.com/deepfire/cl-org-mode (relatively newer)
- https://cl-org-mode.common-lisp.dev/ (oldest)
- They're both old and unmaintained.
- The one in quicklisp is the oldest one.
>>105680700I've got a solution, but it's kinda retarded
(define (cont-frac n d k)
(if (= k 0) 0
(/ (n k)
(+ (d k)
(cont-frac
(lambda (x) (n (+ 1 x)))
(lambda (y) (d (+ 1 y)))
(- k 1))))))
>>105685142Sorry, it should be
(define (cont-frac n d k)
(if (= k 0) 0
(/ (n 1.0)
(+ (d 1.0)
(cont-frac
(lambda (x) (n (+ 1.0 x)))
(lambda (y) (d (+ 1.0 y)))
(- k 1))))))
>>105684915everyone I have ever met who uses julia says it has one of the worst ecosystems ever
tile
md5: e6b93a6934f3de1af9ef2c6f9cff41d1
๐
>>105677677It worked. What I realized after running it is that this will let me manage a lot more windows than I previously could. I would have never tried to open this many windows (or more) in the past, but I can now.
>>105685170I don't think that's fair. Julia's ecosystem is very different from any other ecosystem I've previously encountered, because it's dominated by scientific computing. You're going to find things in the Julia ecosystem that you might not find anywhere else. Browse through this to see the kinds of libraries people are writing with Julia.
https://github.com/JuliaRegistries/General/pulls
^-- This also gives you a glimpse into how packages are published in the Julia ecosystem. It's very streamlined and easy for developers. Whenever you want to make a release, pick a commit and attach a comment to it like:
@JuliaRegistrator register()
...and the JuliaRegistrator bot will get the process started. Your new release will be tagged and available to the general public in a few minutes. I think they did this part very well.
The downside that I feel the most in Julia is that the community isn't the biggest. That can be good too, but the bad side is that you won't always be able to find what you're looking for or if you do, sometimes it's unmaintained for a few years. This isn't a problem that's unique to Julia, but I will admit that you feel that more when you're in a smaller community. If anything, the various Lisp communities might feel this pain worse.
>>105685392>https://github.com/JuliaRegistries/General/pullsIt might be better to looked at the closed pull requests, because the open ones are either very new or have issues that prevent merging and releasing.
https://github.com/JuliaRegistries/General/pulls?q=is%3Apr+is%3Aclosed
>>105685217Glad to hear it, I got tired of hitting C-x 1 and reorganizing things manually.
Just a note, after using this more, minibuffers get really weird sometimes
>>105685490>Just a note, after using this more, minibuffers get really weird sometimesI haven't encountered that yet, but I'll say something if it becomes a major problem.
>>105685766I was testing out treemacs and it had an aneurysm
>>105665341>Lokke intends to provide a full dialect of Clojure for Guile. It also consists of a set of Guile modules providing some of Clojure's functionality in two different guises.https://github.com/lokke-org/lokke
file
md5: 6a1f4d27d012748fc2c296eb4e776b4b
๐
>>105686034>treemacsThese days, I just use dired + dired-subtree.
(use-package nerd-icons-dired
:ensure t
:hook
(dired-mode . nerd-icons-dired-mode))
(use-package dired
:ensure nil
:commands (dired)
:hook
((dired-mode . dired-hide-details-mode)
(dired-mode . hl-line-mode))
:config
(setq dired-recursive-copies 'always)
(setq dired-recursive-deletes 'always)
(setq delete-by-moving-to-trash t)
(setq dired-dwim-target t)
(setq dired-mouse-drag-files t))
(use-package dired-subtree
:ensure t
:after dired
:bind
( :map dired-mode-map
("<tab>" . dired-subtree-toggle)
("TAB" . dired-subtree-toggle)
("<backtab>" . dired-subtree-remove)
("S-TAB" . dired-subtree-remove))
:config
(setq dired-subtree-use-backgrounds nil))
(use-package trashed
:ensure t
:commands (trashed)
:config
(setq trashed-action-confirmer 'y-or-n-p)
(setq trashed-use-header-line t)
(setq trashed-sort-key '("Date deleted" . t))
(setq trashed-date-format "%Y-%m-%d %H:%M:%S"))
>>105688341Credit to prot for this dired config. All the dired parts are from here:
https://protesilaos.com/codelog/2024-11-28-basic-emacs-configuration/
>>105684942There is plump, it works well.
>>105683295You're totally right. Not sure what I was thinking yesterday -- I think I just needed to know that the (putatively) most elegant solution was either impossible or required holding in my head a structure too big to fit in said head. I gave up and wrote the next-most elegant solution, which starts at the innermost n.k/d.k term and recursively "encloses" itself until it hits k=1:
(define (cont-frac2 n d k)
(define (enclose term k)
(let ((this (/ (n k) (+ (d k) term))))
(if (= k 1)
(/ (n k) term)
(enclose this (- k 1)))))
(enclose (/ (n k) (d k)) (- k 1)))
This is much more elegant than what would have resulted from the other approach and I think I'm satisfied with it. I'm a little proud of it, even.
>>105688742I actually initially tried to do it the way you did but couldn't wrap my head around getting the terms in the right order, so I did
>>105685159 instead.
I'm not really sure what the point of either of these methods would be, using a normal reduction would be massively simpler, more intuitive, AND would avoid the pileup of stack space holding the extra state. I can't really think of any situation where you'd specifically want to do it like this aside from as a puzzle/exercise.
>>105688829Yeah the space complexity is definitely much worse with my algorithm, and as far as I can tell the time complexity is similar or functionally the same (but I'm still fairly fuzzy on complexity analysis... I first gave it a real shot, well, a chapter of SICP ago). I think there's a semantic elegance to it and it tweaks my autism for sure, but beyond that... you're probably right. At the same time, it was a pretty novel shape to me and I feel like I've intuitively learned something about computation in the process of struggling through this. Since SICP seems so far to be as much a kind of "philosophy of computation" as much as it's anything else... maybe there was value to the process?
Or maybe I wasted three or four hours on a pointless puzzle. I dunno.
>>105688742>>105688877Good morning sars, read on named let sir
>>105689065We find have named let yet at that point in the book. There are many ways to trivialize the problem (eval comes to mind). The point is to work within the constraints.
>>105662875Smalltalk gets a lot of praise but does it do anything better than lisp? I heard the IDE is "more interactive" whatever that means.
how to compile s7 in windows
>>105689139You can be your own named-let:
;; cont-frac = n1/(d1+(n2/(d2+n3/d3 + ... (dk-1 + nk/dk)))
(define (cont-frac d n k)
(define (aux k acc)
(if (= k 1)
acc
(aux (- k 1) (+ (d (- k 1)) (/ (n (- k 1)) acc)))))
(aux k (/ (n k) (d k))))
In this case I start from the last value then build it by accumulating the denominator sums. GOod morning sar.
>>105688341Having comments in a "handwriting" font is a nice touch.
>>105689392Forgot the resullt:
scheme@(guile-user)> (cont-frac (lambda (i) 1.0) (lambda (i) 1.0) 50)
$9 = 1.618033988749895
>>105689404>Having comments in a "handwriting" font is a nice touch.Using VictorMono Nerd Font is like using two fonts in one. There were a handful of paid fonts that do this too, but I forgot what they were called. There's a guy in #emacs who goes by SummerEmacs who is quite a font aficionado. He showed me the paid ones.
>>105689412Oops, my code gets stuck if k = 0... This fixes it.
(define (cont-frac d n k)
(define (aux k acc)
(if (<= k 1)
acc
(aux (- k 1) (+ (d (- k 1)) (/ (n (- k 1)) acc)))))
(aux k (/ (n k) (d k))))
(do ((i 1 (+ 1 i)))
((>= i 30) i)
(display (cont-frac (lambda (i) 1.0) (lambda (i) 1.0) i))
(display "\n"))
=> 30
1.0
2.0
1.5
1.6666666666666665
1.6
1.625
1.6153846153846154
1.619047619047619
1.6176470588235294
1.6181818181818182
1.6179775280898876
1.6180555555555556
1.6180257510729614
1.6180371352785146
1.6180327868852458
1.618034447821682
1.618033813400125
1.6180340557275543
1.6180339631667064
1.6180339985218035
1.618033985017358
1.6180339901755971
1.6180339882053252
1.6180339889579018
1.6180339886704433
1.6180339887802426
1.618033988738303
1.6180339887543225
1.6180339887482038
>>105689392>GOod morning sar.I'm not Indian. I'm just trying to work hard from first principles.
>>105689626sar, please respect me I am trying to do the needful and help
>>105689626>>105690139jokes aside, using a auxiliary function(s) that are called recursively is such a common idiom in scheme that the named let was created. Similar things happen in other functional langs like haskell, but in haskell you can use where in the end instead of a let or define at the beginning.
>>105690139>>105690162Sorry. I'm autistic and very prickly sometimes. So if I understand what you're saying, the pattern I derived naively from the problem is one that's common enough that named let was developed as a formal idiom. I'll keep that in mind... it'll make it easier to make that connection when I'm assuming it comes up later in the book.
Ty saar and gm
>>105652832Why are not only the title bars differing in height, but also the close, minimize and maximize buttons of different sizes across the two windows on the sides?
>>105668880>>105673110Accessing files from WSL that are outside WSL and vice versa adds a noticeable delay to every read and write. It's a pain.
>>105652614 (OP)Anybody here ever use IPL? Proto-Lisp sounds cool
>>105684409Thanks anon that was fun to read (the latter half was kinda complicated), I was wondering about lambda without type annotations (like s3.3 in the pdf) and it looks like that's addressed in s5 (with subst)
With these changes to
>>105683999 lambda can be written without type annotations
(define (update bind type table)
(set-cdr! (assoc bind table) type)
type)
[('lambda bind body)
(set! table (cons (cons bind 'a) table))
(let ([type (test body table)])
(list (lookup bind table) '-> type))]
[(f x)
(match (list (test f table) (test x table))
...]
[('+ x y)
(match (list (test x table) (test y table))
[('Int 'Int) 'Int]
[('Real 'Real) 'Real]
[('a 'Int) (update x 'Int table)]
[('a 'Real) (update x 'Real table)]
[('Int 'a) (update y 'Int table)]
[('Real 'a) (update y 'Real table)]
[(a b) (format #t "type error: (+ ~a ~a)~%" a b) #f])]
with the limitation that most polymorphic terms don't check
(check (lambda x (+ x 1))) ;=> (Int -> Int)
(check ((lambda x (+ x 1)) 1)) ;=> Int
(check (lambda x x)) ;=> (a -> a)
(check ((lambda x x) 1)) ;=> type mismatch: ((a -> a) Int)
(check (lambda x (+ x x))) ;=> type error: (+ a a)
'Luv me Lisp.
'Ate imperatives.
Simple as.
>>105691512why did you eat the imperatives
>literally just realised setq and setf are not the same
this is the last time i listen to people on the internet, i'm going back to reading actual books to learn
ngl, you guys giving me some good feedback on my window script is a really nice feeling, I appreciate it
>>105692024>>105692184yeah there is the whole "Place" idea. Big brain stuff.
gnus makes me feel stupid
>>105694085Agreed, I tried it yesterday and I've been completely and totally filtered
>>105690218(define (my-func)
(let name ((var init))
... do stuff))
====> is almost like this
(define (my-func)
(let ((name (lambda (var) (... do stuff))))
(name init)
I took a nap and slept right through the lispy gopher show. feels bad, man.
https://gamerplus.org/@screwlisp
https://archives.anonradio.net/202506250000_screwtape.mp3
telnet lambda.moo.mud.org 8888
>>105689438Interesting, I'll have to look into that. Never really had occurred to me that such existed.
is there a way to see what percentage of the way you're into an entire info mode manual? Not just the current section
>>105696372Conceptually,
- you'd have to flatten the info node tree into a flat linear sequence;
- you'd have to find where in that sequence the current node is;
- then you can do some simple math to derive a percentage.
What is your (emacs-init-time)?
ELISP> (emacs-init-time)
"1.966295 seconds"
>>105692024Iโve also seen a lot on people saying theyโre the same
people say that emacs isn't a text editor it is an environment for doing all sorts of things. but it seems like it was designed to be a text editor. are there any attempts to intentionally design something like emacs?
>>105698027Emacs isnโt just a text editor itโs more like an attempt to recreate a Lisp machine inside your modern OS
>>105698027emacs is super duper mega text editor 64
emacs takes text editing and applies it to many things beyond just changing the contents of text files
>>105698027GToolkit? https://github.com/leoshimo/vrs?
>>105696538Welcome to the Emacs shell
~ $
emacs-init-time
3.257864 seconds
~ $
wc -l ~/.config/emacs/README.el
2542 /home/ANON/.config/emacs/README.el
~ $
[\code]
>>105665081>hiding implementation details is badI mean yeah, lisp is about power to the programmer. You should be able to move through the different levels of abstraction in a program and dive into the implementation details when the abstraction isn't working anymore.
>>105688619>>105685011I think it is because writing a HTML parsers is not easy because html "in the wild" is a shitshow, since CL's ecosystem is kinda dead people don't even bother.
Attention TRAMP users:
https://coredumped.dev/2025/06/18/making-tramp-go-brrrr./
>>105699175you have a huge foot
BORN TO RECURSE
WORLD IS A CLOSURE
้ฌผ็ฅ Anonymize Em All 1989
I am lambda man
410,757,864,530 GARBAGE COLLECTED VARIABLES
Am I retard or gpt.el is actually hard to be configured? Like, why is it hard to check multiple API keys, switch it? Why am I struggle? Btw I've been using emacs for a month
>>105696372info_line_percentage ()
{
manual=$1
search=${*:2}
info --subnodes $manual -o /tmp/info.txt
lines=$(wc -l /tmp/info.txt | cut -d' ' -f1)
match=$(grep -nm1 "$search" /tmp/info.txt | cut -d: -f1)
percent=$(sbcl --noinform --eval "(format t \"~a~%\" (* (/ $match $lines) 100.0))" --quit)
echo $percent% in $manual
}
$ info_line_percentage libc "POSIX says that simple calendar times do not include leap seconds"
50.98632% in libc
an elispgod will rewrite this abomination
The quarter is ending so it's time keep myself accountable. While not all of this was directly working on SICP... everything from a month and a half or so ago was. I stopped all my projects and started working exclusively on SICP. My goal was a conservative 2 hours a day for five days a week. My plan on July 1st is to kick that up to three hours a day. I've got one problem left in chapter 1, after which I'll have read every word and done every exercise in said chapter. By this time next year, I hope to be done with both the wizard book and the dragon book and to start on some similarly foundational book on data structures. After that, I have no fucking clue what I'll do. Maybe start posting in /utw/ because who the FUCK is going to hire me?
really dumb newbie question but how do i make emacs close parenthesis automatically?
>>105700621electric-pair-mode
I'm having issues with elfeed, mainly with morss and... ssl handshakes. All I'm getting from the log is picrel.
The links do work properly if I open them up on my browser, and they were working until not too long ago.
Anyone read the art of the metaobject protocol? These ideas seem like actual wizard-tier programming. Unbelievable the level of difference in sophistication between C++ style OOP and Lisp's version. Feels like the future is in the past.
>>105699672Normal people:
>I'll write a program that does somethingUnix trannies:
>I'll use 7 programs that don't do what I want and glue them together to get a program that does 80% of something in a fragile buggy way
>>105701479It somehow works on my phone but not on my PC (WIndows).
What the fuck, doesn't it just call curl??
>>105702335Nevermind I'm severely retarded and should immediately commit suicide.
>>105702273>normal person: nothing after anon asked for help 14 hours ago>unix tranny: working if brittle solution
>>105696538ฮป emacs-init-time
2.706442 seconds
I'm running exwm btw
>>1056965380.207875 seconds
>>105702273Unix trannies:
>I'll use 7 programs that don't do what I want and glue them together to get a program that does 80% of something in a fragile buggy wayNormal people:
>don't do anything because there's not an app for it
>>105703030Genera is dead, unix won
>>105703645>unix wonGNO.
GNU (GNU's Not Unix) won.
>>105700280its not a bible, just do whatever man. Its an intro to CS, a good one. but just that.
>>105704531I disagree, but I'm willing to agree to disagree.
>>105699672just use less sir
>>105696372>is there a way to see what percentage of the way you're into an entire info mode manual? Not just the current section(defun Info-percent ()
"Return what percentage of the way you're into the current info manual.
Examples:
;; Return a plist with current-line, total-lines, and percent.
ELISP> (with-current-buffer \"*info*\" (Info-percent))
(current-line 113 total-lines 2569 percent 4.398598676527832)
"
(interactive)
(without-restriction
(let* ((current-line (line-number-at-pos))
(total-lines (line-number-at-pos (point-max)))
(percent (* (/ (float current-line) total-lines) 100.0))
(result `(current-line ,current-line
total-lines ,total-lines
percent ,percent)))
(message "%s" result)
result)))
Examples:
ELISP> (with-current-buffer "*info*" (Info-percent))
(current-line 77 total-lines 2569 percent 2.997275204359673)
ELISP> (plist-get (with-current-buffer "*info*" (Info-percent)) 'percent)
2.997275204359673
>>105699672This reminded me that the info viewer in Emacs just narrows the buffer when it moves between sections of an info manual. An info manual is all in one file. That's what let me write a simple interactive Elisp function.
You know what I'm a little surprised by?
Imenu doesn't work for info manuals.
I feel like it would make info manual navigation really nice in Emacs if it did work.
>>105702805I don't use brain damage like "info" or "man" pages.
>>1056965385.007982 seconds
Racket has the most unique features of any Lisp
>muh educational language
absolute fucking BULLSHIT!
literally one of the most advanced languages that I've seen (ignoring experiments with type systems)
>sandboxed evaluation
>contracts
>weak maps
>insane metaprogramming capabilities
I even think "places" are separately garbage collected like in Erlang/Elixir.
>>105707820That's the reason I can't stand it. it makes my head hurt knowing everything I'm doing is ontop of a dozen layers of complicated shit. The more I learned the more anxious I got while using it. Probably you can just ignore/forget about that stuff but I keep thinking about it and it's distracting.
It's kinda ironic that I prefer emacs over vim since it's kinda the same "I thought this was a text editor not a bottomless pit"
>>105707866I find it hard to wrap my head around any recommending emacs to you and describing it unironically as just a text editor, that's basically a form of animal cruelty
>>105709242I only warmed up to it after years of using vim. Initially, not knowing the possibilities, I couldn't stand emacs bloat. But after finally mastering vim and more and more frequently looking up "how to do X" and having the answer be "you can't" or "here's some incredibly convulted hack to do it" and then by contrast see people dumping custom elisp code to do LITERALLY FUCKING ANYTHING YOU WANT I switched.
Racket might be the same, until you reach the limits and WANT some capability you don't have the additional overhead is just a burden. I just look at all those features and think "wow that's neat but when would I ever want to use any of this shit?" and so far I can't figure out an answer, CL seems to be able to do pretty much everything I want so far, I've literally not once run into something I couldn't do.
>>105671485Thoughts on Prolog?
anyone knows how to disable size display in dired? i think this might slow down Tramp when is enabled (its enabled even with emacs -Q, using emacs 30.1.50)
>>105699142thank you big sir
>>105710090(setq dired-free-space nil)
>>105710210thank you, i was searching with keyword available :/
I would like to use AI to guide me through customizing emacs just the way I want it.
Last time I tried this with ChatGPT, it was a mess of hallucinated elisp and configuration options.
What's a good model that will know how to answer my questions about emacs configuration so I can learn the ins and outs more efficiently than just stumbling through the documentation?
I don't want to have chatgpt do it for me, but to act as an emacs expert who can point me to the right settings and functions to use.
>>105699305>Why am I struggleBecause you rely on ChatGPT too much.
>>105711000i find deepseek is unironically better at lisp and emacs for some reason
but they're all terrible