[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: Land_of_Lisp.png (812 KB, 1500x2000)
812 KB
812 KB PNG
>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 (Site)
https://github.com/emacs-tw/awesome-emacs (Awesome Emacs)

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

>Emacs Distros
https://spacemacs.org (Spacemacs)
https://doomemacs.org (Doom Emacs)
https://ergoemacs.github.io (Ergoemacs)

>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 (Introduction to Elisp)
https://gnu.org/s/emacs/manual/elisp.html (Elisp Manual)

>Common Lisp
https://lispcookbook.github.io/cl-cookbook (CL Cookbook)
https://cs.cmu.edu/~dst/LispBook (CL: A Gentle Introduction)
https://gigamonkeys.com/book (PCL)
https://lem-project.github.io (CL editor/IDE)
https://nyxt.atlas.engineer (CL Browser)

>Scheme
https://docs.scheme.org (Docs)
https://scheme.com/tspl4 (TSPL4)
https://eecs.berkeley.edu/~bh/ss-toc2.html (Simply Scheme)
https://archive.org/details/Schemer (Books)

>Clojure
https://clojure.org (Site)
https://clojure-doc.org (Docs)
https://mooc.fi/courses/2014/clojure (Functional programming with Clojure)

>Guix
https://guix.gnu.org/manual/devel (Guix Manual)
https://systemcrafters.net/craft-your-system-with-guix (Introduction to Guix)
https://gitlab.com/nonguix/nonguix (Nonguix)

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

>More Lisp Resources
https://paste.textboard.org/52b08691

(defparameter *alt-names* '(/emg/ /emac/ /lambda/ /lol/ /let/ /flet/))
(setf *prev-bread* >>100279706)
>>
File: fio_germi-by-wamudraws.jpg (366 KB, 1275x1411)
366 KB
366 KB JPG
>https://sbcl.org/all-news.html#2.4.4
>>
File: 1685261559225.gif (69 KB, 260x261)
69 KB
69 KB GIF
>>100279930
>https://gitlab.com/NalaGinrut/guile-lua-rebirth
Based (on Lua)
>>
Any physics libraries/bindings for CL? I found this one:
https://github.com/borodust/aw-physx
But it looks kinda janky, like this example:
https://github.com/borodust/aw-physx/blob/master/example/example.lisp

(defun make-foundation (allocator error-callback)
(%physx:px-create-foundation '%physx:physx+px-u32 67174656
'(:pointer %physx:physx+px-allocator-callback) allocator
'(:pointer %physx:physx+px-error-callback) error-callback))

Doesn't read like example code but library code to me.
>>
>>100295607
Very nice. Thanks, /g/entleman.
>>
First for I'll try combobulate any year now.
>>
File: peperl$wizard.png (1.21 MB, 1332x1801)
1.21 MB
1.21 MB PNG
HIGHER-ORDER PERL is the most powerful LISP dialect.
>Around 1993 I started reading books about Lisp, and I discovered something important: Perl is much more like Lisp than it is like C. If you pick up a good book about Lisp, there will be a section that describes Lisp’s good features. For example, the book Paradigms of Artificial Intelligence Programming, by Peter Norvig, includes a section titled What Makes Lisp Different? that describes seven features of Lisp. Perl shares six of these features; C shares none of them. These are big, important features, features like first-class functions, dynamic access to the symbol table, and automatic storage management. Lisp programmers have been using these features since 1957. They know a lot about how to use these language features in powerful ways. If Perl programmers can find out the things that Lisp programmers already know, they will learn a lot of things that will make their Perl programming jobs easier.
https://hop.perl.plover.com/book/pdf/HigherOrderPerl.pdf
>>
File: Konosuba_Darkness_Perl.jpg (279 KB, 1920x1080)
279 KB
279 KB JPG
>>100336599
TRVTHNVKE
http://xahlee.info/perl/perl_index.html
>>
>>100337073
> Perl does automatic conversion between number and string, so '0' is false in some contexts because it converts to 0. But '0.0' is true, because it remains a string, and is not empty string.

Just fuck my shit up
>>
Why doesn't Lisp have static typing?
>>
>>100337628
Because John Lisp, when making lisp was tired of writting C.
>>100337172
The tricky bit there is literally the word "context", it's not the author choice, Perl literally has something called "context". It's not lolnoscope ("hello" + 10) as JS, but it will try to work with text when it makes sense.
>>
>>100337706
For example: Reverse just reverses a list when used in a list CONTEXT. But when used in a scalar context, it will convert what it things is the representation of the element to a string, concat them and reverse lmao.
>>
File: BTFO.png (446 KB, 1000x837)
446 KB
446 KB PNG
>>100258970
Interdasting
>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
>but I'm still sticking with my übermensch (GNU Guix + StumpWM) wizard setup
>>
>>100337706
Even in JS these random type conversions are rarely an issue as long as you're writing sensible code.
The unfortunate truth is that everyone is slinging random shit.
>>
Am I the only one that think that most Emacs keyboard shortcuts are bad by default?
>Save in Emacs: C-x C-s
>Save anywhere else: C-s
>Select all in Emacs: C-x h
>Select all anywhere else: C-a
I like it when Emacs easily does something that other text editors don't, but it's very annoying when some things require double the key strokes.
>>
>>100338539
I think this is because the shortcut scheme for the basic editing commands is older than emac itself (and still in use through GNU readline)
>>
>>100338230
Yeah, in perl specifically they are not an issue. Operations on strings are different than those on barewords, numbers and other stuff.
>>
>>100338539
>Am I the only one that think that most Emacs keyboard shortcuts are bad by default?
GNUtards laser-focus on picking the worst possible defaults possible. It's literally amazing, they pick the global maximum of bad defaults like it's easy. It would take Microsoft a couple of years to even get close.
>>
>>100338908
So why are you here? What have you done to make your Emacs more tolerable?
>>
>>100338925
>What have you done to make your Emacs more tolerable?
modified my init.el sir
>>
>>100338950
Details!
>>
>>100338539
Another one:
>Undo in Emacs: C-x u
>Undo anywhere else: C-z
>What C-z does in Emacs: Minimise.
>>
File: zed.png (19 KB, 1183x200)
19 KB
19 KB PNG
>zed editor shows git blame as soon as your cursor is on a line
People are fucking crazy
>>
>>100338957
Well for starters
>>100338988
this and c-s-z to undo. C-x c-b remapped to the ibuffer. and backtab to change window.
>>100338539
none of these were changed in mine.


Other things
>throw all the auto save files into one folder and limit them
>electric pair mode
>delete selection mode
>relative line mode
>indent tabs mode to nil
>larger fonts
>removed tool and scroll bars
>removed the bell sound and splash screen
>corfu for completion
>which-key to help me remember stuff
>disable ui dialog box prompts
and that's just it, my init el is like ~100 lines only if you take out spaces and comments
>>
>>100339403
I've also had to remove several ubuntu annoying gnome keybinds that conflicted with my emacs. things like shift-alt-arrows and some other stuff.
>>
>>100339248
Why? I mean, I don't see it useful, but why is it crazy?
>>
Is emacs treesitter worth the hassle of setting up?
>>
>>100340380
>hassle
?
>>
why is emacs bad?
>>
>>100340380
With the latest version it comes included, you just need to require treesitter and treesitter-langs, then run tree-sitter-langs-install-grammars the first time to get the grammars. After that, it should be more or less automatic. just do tree-sitter-hl-mode and it should work.
It is true that sometimes you need to do something like
(add-to-list 'tree-sitter-major-mode-language-alist '(c++-ts-mode . cpp))
if the major mode you're using is not recognized
>>
>>100340599
Many reasons stated in this thread and the previous one.
>>
>>100333946
not lisp, not emacs. go use lite.
>>
>>100340599
>codeium segfaults emacs
>experience was subpar anyway
Fuck it, I'm going to install an emacs emulation extension on vscode
>>
>>100340968
https://github.com/renzmann/treesit-auto
>>100339994
"Crazy" may be an exaggeration, but we as programmers should push towards less visual noise rather than more. It's just bizarre, how often do you need this info anyway?
>>
>>100333946
we're reaching levels of abstraction that shouldn't be possible
>>
>>100341400
>but we as programmers should push towards less visual noise rather than more.
good morning sir, there is a whole language (in fact some say it is the best language) dedicated to producing line noise, it's known as Java sir.
>>
Is there a way that I can test out python-ts-mode? I've turned it on, but I see no differences.
>>
>>100341595
>I see no differences.
What do you expect to see? ts mode isn't supposed to make any visible changes beyond faster syntax highlighting
>>
>>100341752
Error highlighting
https://www.youtube.com/watch?v=CPB6e5AGk6s
>>
File: png.png (181 KB, 640x853)
181 KB
181 KB PNG
>>100341311
>vscode
Enjoy your electroonware™
https://www.bleepingcomputer.com/news/microsoft/vscode-marketplace-can-be-abused-to-host-malicious-extensions/
https://www.bleepingcomputer.com/news/security/microsoft-visual-studio-code-flaw-lets-extensions-steal-passwords/
https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=visual+studio+code
>>
File: wtf.png (12 KB, 598x61)
12 KB
12 KB PNG
I ran Eglot, then my menus changed. What the fuck?
>>
>>100341818
I assume you will need another package for that, afaik *-ts-mode is meant to be a pretty transparent upgrade for now.
>>
Is SBCL smart enough to allocate on the stack or do I have to do it manually
>>
>>100342277
If you declare stuff dynamic-extent then it will allocate them on the stack (as long as it is permissible)
Otherwise it will sometimes allocate stuff on the stack, depending on what you do
>>
Should I use which-key-mode globally?
>>
>>100342552
yes
>>
Are corfu and company-mode competitors? I don't see the difference.
>>
>>100342552
I use embark-prefix-help-command instead, it is a lot easier to find what I am looking for with completion than visually scanning a giant list.
>>
>>100342733
there is only cooperation in the gnu verse
>>
Why do some packages need use-package in my .emacs file but others don't? For example, it took me about an hour and a half to figure out that this is how corfu wants to be configured.
;;Corfu - Autocompletion framework
(use-package corfu
:custom
(corfu-auto t)
(corfu-auto-prefix 1)
(corfu-auto-delay 0.5)
:init
(global-corfu-mode)
(corfu-history-mode))
>>
Here's my Python config. Is it any good?
;;Python

;; Makes an error shut up. Can't remember what it was.
(setq python-indent-guess-indent-offset nil)

;Treesitter - Faster syntax highlighting
(add-to-list 'major-mode-remap-alist
'(python-mode . python-ts-mode))

;;egpot - LSP client.
;;The pylsp LSP server is installed, but does not require configuration here.
(use-package eglot
:hook (prog-mode . eglot-ensure))

;;Corfu - Autocompletion framework
(use-package corfu
:custom
(corfu-auto t)
(corfu-auto-prefix 1)
(corfu-auto-delay 0.5)
:init
(global-corfu-mode)
(corfu-history-mode))


I haven't yet bothered with Git, a debugger, venv stuff, or things for unit tests.
>>
>>100341903
>Enjoy your electroonware™
It just werks
>meme links
I can play that game too. You should stop using linux! Look:
https://pentest-tools.com/blog/xz-utils-backdoor-cve-2024-30948
Be veeery afraid!
>>
>>100343988
use-package will install packages that aren't already installed. The packages you are configuring without it are probably distributed with emacs and so they don't need to be installed.
>>
>>100343988
Nothing needs use-package. It's just a helper package.
You can just
package-install corfu and then put this in your init:
(require 'corfu)
(setq corfu-auto t)
(setq corfu-auto-prefix 1)
(setq corfu-auto-delay 0.5)
(global-corfu-mode) ;I'd rather add corfu to particular hooks
(corfu-history-mode)
>>
Should I learn common lisp or scheme? I'm in uni studying CS so I don't have too much free time on my hand , but I really want to check out some sort of Lisp language.
>>
>>100344579
depends if what you want is intellectual masturbation or practicality. If you actually just want to write code in Lisp and optionally interface with C just roll with CL. If you just wanna learn just do SICP or something.
>>
>>100344579
>I don't have too much free time on my hand
scheme
>>
>>100344216
>use-package will install packages that aren't already installed
As long as you either do
(use-package foo :ensure t)
;;or
(setq use-package-always-ensure t)
>>
>>100344624
Well ideally I'd like to implement it into some sort of future project, but also using the language to learn concepts i'm currently studying at uni would be cool too
>>
>>100344712
then just learn CL and don't think about it
>>
>>100344733
ok I'll give it a go, fren
>>
>>100344579
After learning one it'll take like 5 minutes to learn the other one so don't worry.
I also agree CL is by far more practical.
Scheme is however MUCH better if you want to study the language itself since it's simpler.
So anything to do with compilers/interpreters/etc... is much easier to do in scheme. Like a single guy can implement r7rs by himself fairly easily, but good luck doing that with CL, it's just not going to happen.
>>
>>100338988
>Undo in Emacs: C-x u
C-/
>>
>>100345628
Thanks anon.
>>
>>100338539
Default emacs is unusable. I would just use vscode or something if it weren't for Doom Emacs and Spacemacs.
>>
>>100346212
my config is like 100 lines, it's super straightforward if you use package.el
>>
File: schemes.png (377 KB, 1024x1024)
377 KB
377 KB PNG
>>100344579
Scheme.
>>
I'd like to make a language with hygienic macros and non hygienic macros where you would define each with this syntax and each type of macro would have its own keyword.
KEYWORD IDENTIFIER(PARMS) BODY

"macro" is a good keyword but I need a 2nd one, any ideas?
Not "defmacro" or something like that, "syntax" also feels wrong.
>>
>>100338539
>>100346212
default emacs is harder to use than editors following a more traditional keybinding scheme, but on the other hand any other editor is unusable compared to a well-configured emacs. whenever I have to write more than 3 lines of text I have to do it on emacs, I can't live without my personal modifications. to me it's actually the opposite, I often press C-x in other editors out of muscle memory and end up cutting stuff I didn't want
>>
>>100333946
this gif is amazing
>>
>>100337172
>so '0' is false in some contexts because it converts to 0.
'0' and "0" are false in all contexts. either it remains a string in which case it is false, or it is converted to the number 0 in which case it is also false. Also perl does not convert a string to see if it's true or not, I just checked.
>But '0.0' is true,
yeah but what about '000.0', '00000.0000'? that's the same float 0.0 so if you would want the language to have this value be zero in boolean context you'd need 2 while loops. In the situation where you even need that you can still convert it to a float manually -> if ($str+0) {} / if ("0.00"+0) {}. Besides, the float 0.0 is converted to string "0" and this returns 1: "".(0.3 - 0.3) eq "0"
>>
>>100336599
There is another underrated feature of Perl which is that the function call stack will grow as needed instead of dying like Python, Ruby, JS and Lua do.
People always talk about tail call recursion optimization but having a growable stack is equally important for functional programming in order to process eventual deep nested data structures, because otherwise you need to rewrite your algorithm with a while loop and a stack instead.
>>
>>100337172
reading this I finally understand why lisp, despite being dynamically typed, feels more solid and firm than languages like javascript and perl. it's because it doesn't ever do auto-conversions, the types are very strongly enforced at runtime. the only type errors that can happen are passing a completely wrong value, but that will crash the program, it's a lot harder to make it fail silently like javascript
>>
going back to programming rust after spending a month in lisp land and it feels so disgustingly ugly ._.
>>
>>100350502
Same, I dropped cepples and Rust just cause it's too comfy. I'm still a noob so maybe I'll hit a limit at some point but the perf has been pretty good.
>>
>>100350598
yeah unfortunately i need systems lang level perf for some things.
if it wasn't for that i'd be using lisp for everything. it's just so smooth
>>
>>100350695
what do you need rust for? is it pure performance or realtime (no gc) that has you going back?
>>
>>100350145
>if you would want the language to have this value be zero in boolean context you'd need 2 while loops.
I don't want that, I want the madness to end.
>>
>>100350972

I don't want that either, in fact I don't want the falsy behavior of "0" and now that I think about it, why even have "" falsy and what does it mean? undef is enough
>>
>>100347079
Show it.
>>
>>100348964
But what exactly is a well configured Emacs? What are your configurations?
>>
>>100351608
I use vanilla binds for everything, so I legit just have:
(global-set-key (kbd "C-c e") 'flymake-show-project-diagnostics)
(global-set-key (kbd "C-c n") 'flymake-goto-next-error)
(global-set-key (kbd "C-c p") 'flymake-goto-prev-error)
(define-key eglot-mode-map (kbd "C-c a") 'eglot-code-actions)
(define-key eglot-mode-map (kbd "C-c r") 'eglot-rename)

After that it's ~30 lines of misc settings:
(setq initial-scratch-message "")
(setq inhibit-startup-message t)
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(electric-pair-mode)
(set-face-attribute 'default nil :font "GalmuriMono11-9")
(add-to-list 'default-frame-alist '(font . "GalmuriMono11-9"))
(setq display-line-numbers-type t)
(global-display-line-numbers-mode 1)
(setq display-time-day-and-date t)
(display-time-mode 1)
(global-display-line-numbers-mode t)
(setq-default display-line-numbers-width 4)
(setq compilation-ask-about-save nil)
(winner-mode)
(setq fringe-mode 'minimal)
(setq-default x-gtk-resize-child-frames 'resize-mode)
(fset #'jsonrpc--log-event #'ignore)
(setq undo-limit 8000000)
(setq undo-strong-limit 12000000)
(setq read-process-output-max (* 1024 1024))

The rest are all packages: eglot, sly, doom-modeline, hungry-delete, indet-guide, vertico, corfu, markdown-mode, rustic, yasnippet, treesitter, magit/forge, orderless, which-key, and dashboard. Most of those are 1-3 lines using use-package. And that's pretty much it for the config. I find you can get used to the vanilla binds pretty easily.
>>
>>100351669
>I find you can get used to the vanilla binds pretty easily.
I strongly dislike the vanilla binds, but I wonder if combobulate might be the minimal improvement I want.
>>
>>100351938
have you tried palm press? made a world of difference for me.
>>
>>100351941
>palm press
what?
>>
>>100351669
I will return to this.
>>
>>100351982
press ctrl with your left palm instead of pinky. I do this for most ctrl presses.
>>
>>100352021
there's nothing special about it, just what I came up with ~1 week after trying doom Emacs. should work as a good starting point though.
>>
>>100352132
Oh. I have ctrl on my thumb key
>>
>>100352289
where do you have alt? if it's on the leftmost then palm press it
>>
>>100352874
I have a kinesis advantage 2 so it's all on the thumbs
>>
>>100352957
oh I see. no clue how that works.
>>
Good morning sirs wishing you all a wonderful day
>>
File: java.png (951 KB, 1500x1500)
951 KB
951 KB PNG
>>100354101
good morning emacsir
time to redeem java
http://xahlee.info/java-a-day/java.html
>>
>>100355681
I actually read some of xah's tutorials. They're good but only if you're already somewhat familiar with the territory.
Teaching is a very hard thing to do I don't think most technically minded people are capable of it.
>>
>>100351617
my config is about 1000 lines. it includes 60 or so packages, and the rest is my own elisp functions
>>
>>100344579
>i'm studying so i don't have too much free time
OH, believe me. You have a LOT of time compared to what awaits you. Wait until you enter the workforce and you will know what hell is.
>>
>>100351669
>(global-display-line-numbers-mode 1)
Do you enjoy line numbers in your corfu tooltips?
>>
>>100351669
>Galmuri
Do you enjoy not finding typos because you're using a meme font?
>>
>>100342552
yes. it has never gotten in the way in my experience. it only helps.
>>
>>100357077
huh? the font works great and is super legible. it's the only one I could find that looks good and is really thin which lets me fit everything in a vsplit
>>
>https://www.in.gov.br/consulta/-/buscar/dou
officially gave up on trying on scrapping this. I have no idea of how to deal with the pagination save going full puppeteer and literally clicking the button.
>>
>>100359013
>pagination
dude just get the href of the link and make a new request lmao
t. didn't actually look at the page (doesn't load for whatever reason)
>>
Is there a way to get smart-tabs-mode working on c-ts-mode?
last update was 4 years ago, and I don't know if smart-tabs is within scope of c-ts-mode
>>
>>100359509
>>100359491
>>100359013
Fuck I had scrapper general in another tab. Sorry folks. Got confused I need to sleep.
>>
(define (sin angle)
(if (not (> (abs angle) 0.1))
angle
(p (sin (/ angle 3.0)))))

Why does SICP use
(not (> ...
instead of just using <= ?
>>
>>100359594
For the same reason your dad fucks you with two condoms: It is sometimes best to use more than you need.
>>
File: mysql.png (29 KB, 801x180)
29 KB
29 KB PNG
Ever since I've installed an LSP, I've had MySQL running in the background. Is this okay? Is it secure to do that? Is it really taking half a gig of RAM? I'm on a low-spec machine.
>>
>>100360823
that's kinda weird. What lsp?
>>
>>100360823
you sure that's because of an lsp? doesn't starting and enabling systemd services require sudo?
>>
>>100361082
there are user services that don't, though that one looks like a system service
>>
Any tricks to make emacs run faster on windows? I run linux on my main pc but emacs on my work laptop is pretty sluggish. Magit is the worst offender but it's slow in general on a relatively decent laptop.
>>
>>100361052
>>100361082
Yeah, I'm pretty sure it's Eglot.
>>
>>100361292
that's not eglot, that could be an LSP server you're using. What LSP is it.
>>
>>100361224
Unironically, just run Emacs in WSL.
>>
>>100361319
pylsp
>>
>>100361357
I thought about it but doesn't it struggle to interact with the native windows filesystem?
>>
>>100361396
It's not too bad, especially compared to the nightmare of WSL1. Performance isn't stellar, but still better than Emacs on Windows.
>>
I don't like how Emacs keeps on leaving autosave files littered around my file system. Is there a way to make them auto-delete after closing Emacs? Should I even want that?
>>
>>100361458
i would personally just disable those, but check out the no-littering package, if only for the info it has on its page
>>
>>100361458
(setq backup-directory-alist '(("" . "~/.emacs.d/backup/per-save")))
(setq backup-by-copying t)
(setq delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t)

good evening SIR it does the needful and puts all the poo in one loo only
>>
>>100362970
hello SIR does folder need to exist or it will created automatically?
>>
>>100362970
jeetposting will never get old
>>
>>100351669
that's actually shorter than my doom config:
https://termbin.com/tuu5
>>
>>100363829
eh it's probably a bit longer with all the package declarations but yeah it's pretty short
>>
Why is this wrong
(define (fastexp x n)
(if (even? n)
(square (fastexp x (/ n 2))
(* x (fastexp x (- n 1))))))

but this is right
(define (fast-expt b n)
(cond ((= n 0) 1)
((even? n) (square (fast-expt b (/ n 2))))
(else (* b (fast-expt b (- n 1))))))

Sometimes I struggle with figuring out how using if versus cond affects how a program runs. Can someone help?
>>
>>100363069
I don't know it just works, in doubt create yourself or put in another dir
>>100363206
thank you sir
>>
Will simply scheme help me with the kinds of problems of sicp or does it just helps to cope with parenthesis and recursion?
>>
>>100364199
You've obviously forgotten the n = 0 case. You're not wrong as a programmer, but as a mathematician.
>>
File: fastexpt.png (33 KB, 781x457)
33 KB
33 KB PNG
>>100364199
>Can someone help?
Use a debugger that lets you step through the execution of the program one expression at a time. If you had done that, I'm sure you would've noticed very quickly that you had forgotten the base case.

>cope with parenthesis
I recommend using parinfer and rainbow parentheses
>>
>>100338908
Most things aren't even bound by default in visual sneedio. You're expected to just use the mouse.
>>
Any Perl-sisters here? What do you use? I really miss completion. Corfu doesn't seem to work at all with perl.
I am just raw-dogging with flycheck and perl mode.
>>
>M-SPC ensures only 1 space is present between characters
amazing, there is not a single day without learning something new about my mac
>>
>>100365990
why are you using perl in <current year>
>>
>>100365990
I've been dabbling in Perl but tee bee aych I can't see myself using it for anything complex enough to warrant more than flycheck.
>>
>>100366253
it literally just werks, fast enough, has compiler checks and I like learning new languages. Also even though the ecosystem is a bit dilapidated, most stuff just work too, and will continue working forever probably.
>>
>>100365990
Sir,the needful language servers Protocol.
>>
>>100365990
I prefer to rawdog.
>>
File: ncmpcpp_broken.png (12 KB, 976x538)
12 KB
12 KB PNG
bros my ncmpcpp ueberzug config broke... again.
all i wanted was to show album art in ncmpcpp. this really sucks though, it keeps randomly breaking, and then an update suddenly fixes it, and then suddenly it's broken again. how hard would it be to create this same interface in lisp, but as a GUI so it can display album art properly?
>>
>>100370544
nice font what is it
>>
>>100370565
UW ttyp0, it's pretty comfy.
>>
>>100370642
>multiple sizes
nice, let's go
>>
>>100370544
probably pretty easy, it already has image support
>>
I love Racket's custom languages.
Using rackjure for writing GUI apps and its godly
Shame you cant put together imperative (send ...) commands into a progn block or something like that, hmm. Putting everything on the top-level is icky. (Unless you can? Hmm, just checked the docs. racket/block might suffice.)

Ah... It's a shame Clojure proper doesn't have a good story with desktop GUI other than piggybacking on Spring/JavaFX.
>>
File: 323966 - SoyBooru.png (155 KB, 721x748)
155 KB
155 KB PNG
>>100333840
Are most lisp programmers like this?
>>
>>100372322
I look like this but don't say this
>>
>>100371616
HumblUI brother
Any day now
>>
>>100333840
I recently built a small side project in racket and now my viewport of all other programming languages' syntax is severely corrupted. I just, keep coming back to that lisps syntax is more perfect. It just really feels so nice to program in. Can't explain it
>>
>>100338988
>He doesn't know about vi
>>
I'm a mathlet, when we say the order of growth of a function is O(log n) does that mean that every time we multiply n by a constant, the number of steps or time required grows by a constant amount?
>>100364321
You're right, thanks.
>>100364585
Is there a good debugger for chicken scheme? I just run everything with csi but I don't debug
>>
>>100372322
i look like that and say that
>>
anybody here ever implemented an inference engine in a lisp?
>>
>>100371616
>racket for gui
fren can you help me understand how to handle keyboard events on a frame? Like how do I call a function when the number 1 key is pressed? this documentation is driving me insane, there's no examples or explanations on how to actually use anything...
>>
I feel so hopeless having to look at every solution for SICP's exercises
>>
>>100375748
>is O(log n) does that mean that every time we multiply n by a constant, the number of steps or time required grows by a constant amount?
No, read here: https://stackoverflow.com/questions/2307283/what-does-olog-n-mean-exactly
>>
>>100375748
O(log n) means an increase of x on the size of the input would increase complexity by less than x. for example, a binary search. it takes 6 steps worst case on an array of 50 elements, and 7 steps on an array of 100 elements.
>>
>>100377158
Umm sir ahctually it means that the increase get even less significant as n increases. It's basically reverse exponential
>>
>>100378100
reverse exponential is one of the forms of log n, but I think any kind of <x complexity for n+x input is considered O(log n)
>>
>>100378524
What are you talking about considered. Big O is not some handwavy social studies subject. There is a precise mathematical definition of O(log n).
>>
Damn lisp generals are fast these days.
>>
Trying to switch to doom emacs. The documentation seems to be shit, any decent resources for it?
>>
>>100380067
>The documentation seems to be shit
It is, unfortunately. Doom has problems that could have been fixed years ago, but major ones like updated docs are delayed until Doom V3, which has been just around the corner for 4 years
>>
>>100380067
>>100380109
But to answer your question, the doom discord is very active and you can often both search and ask to get quick help.
>>
>>100380123
Thanks. Discord makes for a terrible repository of information, but I guess if it's the best option I'll use it.
>>
>>100380123
>discord
How the fuck did it come to this unironically. It pains me to see even the autistics using that.
Unimaginable that the PHP forums we had 20 years ago was the peak of the internet.
>>
The bad thing about Common Lisp is that it's basically Python, but without 90% of the libraries.

The good thing about Common Lisp is that it's basically Python, but without 90% of the intrinsic language flaws.

Pick your poison.
>>
>>100380187
So why not Clojure? It's the best of both worlds.
>>
>>100351669
>Global Flymake keys
Why? Surely you only want it for programming?
>>
>>100380816
I mostly program, and I don't have anything else to bind the same binds to so I just didn't bother to change it when I set it while playing around.
>>
>>100380187
Why are you even comparing it to Python? All they share is dynamic languages and (maybe) the REPL (I say maybe cause the Python REPL is useless)
>>
>>100351669
>(winner-mode)
>(setq fringe-mode 'minimal)
>(setq-default x-gtk-resize-child-frames 'resize-mode)
>(fset #'jsonrpc--log-event #'ignore)
>(setq undo-limit 8000000)
>(setq undo-strong-limit 12000000)
Never seen any of these before.
>>
>>100380898
winner is kind of shit, tab-bar-history-mode works a lot better.
>>
>>100380898
>winner-mode
probably the coolest thing for me. It basically enables window history. C-c <left> and C-c <right> go back/forwards your window configuration (how many splits, orientation, what buffers you had on it, etc.). It's super nice for when digging through codebases and I want to revert to the state I was at before. Or sometimes a new buffer will open up but the focus isn't on it, and instead of having to C-x o, then q, then sometimes C-x o again, I just do C-c <left>. Play around with it, it's really nice (comes out of the box).
>(setq fringe-mode 'minimal)
>(setq-default x-gtk-resize-child-frames 'resize-mode)
Just interface stuff.
>(fset #'jsonrpc--log-event #'ignore)
Massively speeds up LSP for me, at least with Rust and C. It just disables logging, which depending on the LSP server you're using can remove a massive amount of data it would otherwise have to parse.
>(setq undo-limit 8000000)
>(setq undo-strong-limit 12000000)
Self explanatory, I have 32gb of RAM I don't mind having a huge undo history lol
>>
>>100380926
That's not really a replacement for winner-mode though. I like winner-mode for quick stuff, like C-x h to view docs for the thing under cursor, and then C-c <left> to go back. Since the doc buffer isn't highlighted by default it'd be more annoying to have to go to the other buffer and close it manually.
>>
What's a basic Emacs feature that you always forget?
>>
File: 1701862653751289.png (1018 KB, 2516x4512)
1018 KB
1018 KB PNG
>clojure didn't make the list
sars.. our response?
>>
>>100381006
When I remember it I'll reply
>>
>>100381840
>top 50
>hack
>xslt
>>
>>100382228
kek yeah it's just scraping github stats without any filtering
>>
>>100382237
It must have another source for Matlab (the correct capitalisation, "MATLAB" is decades out of date) to be top 50, most Matlab code is either shared as part of a course or on the MathWorks forum.
>>
>>100361448
>can't drag and drop
Win32 Emacs is actually decent but it really struggles with startup and opening new files.
I assume this is because of the same reason git is unbearably slow, opening a file on NT/NTFS is ungodly expensive but most Unix tools treat it as basically free.
>>
When are people going to stop using Windows?
>>
>>100383494
As soon as Imperix ports their cockpit to Linux.
>>
I have zero idea what is fucking up, but something is fucking up
>>
>>100376789
As long as you're wholeheartedly trying to solve them yourself first then I don't see a problem with it.

And that you don't just copy paste the answer but actually go through the solution until you understand it.

Also you could use chatGPT as a teacher or someone to throw a ball with.
>>
>>100333840
watching the system crafters introduction video to guix, he mentions you can inherit package definitions and apply your own changes to it. how would i do that? like, if i just want to add/remove a few build flags but keep everything else the same, how do i do this? do i have to rewrite the package and then make it a replacement?
>>
>>100386733
Package definitions are just a record type. Basically just a list with named fields, and you can manipulate the values in those fields however you want. If you inherit another package then any fields you add overwrite the existing ones. For example to make a new version of some-package with different make flags you could do:
(package my-package
(inherit some-package)
(arguments
`(#:make-flags `("CC=gcc"))))

And that's it, all the other fields you didn't specify will remain the same as the package you inherited.

Also it's usually better to append or prepend your make-flags to the existing list instead of just overwriting it but I wanted to keep it simple. In that case it's be better to use the substitute-keyword-arguments function.
>>
>>100387222
thanks, this is a killer feature to me
>>
>>100333840
I currently use bin (https://github.com/marcosnils/bin) to manage/install/update binary releases from github and I'm considering the guix package manager for doing the same when installing from source from git repos. Would it be overkill for this use case though? I'm also a codelet that got filtered an emacs lisp intro recursion exercise, so that's a problem too.
>>
wtf is fastlisp
>>
>>100387824
A forced Pisscord meme
>>
>>100386332
My problem is that I can never figure out where to begin. The structure of the program is a mystery to me. Once I see the answer I get it, but I have trouble coming up with the algorithms on my own.
>>
>>100388224
How long have you been programming?
>>
>>100388281
I never really programmed, not rigorously. I've known basic programming concepts (conditions, loops, operations, classes etc) for a long time but I never worked on any serious project and when I had to program something a couple months ago I just asked chatGPT for some code and then I debugged it, instead of coming up with it myself
So I guess I've dabbled for a long time but never really programmed
>>
>>100388347
It's not strange then that you're having a hard time, these things take time. Best advice I can give you is to make projects and read other people's code.

Never copy paste but it's okay to read and then type it in yourself, that way you at least get something from it.
>>
>>100388389
>make projects
I don't think I'm good enough to start working on a project right now. Especially in Scheme. Is there something else I could read concurrently to SICP that has a more hands-on approach to designing programs, maybe?
>>
>>100388402
I probably have severe undiagnosed ADHD or something because I'm wrangling 3-5 books at the same time. But for you I'm gonna recommend Eloquent JavaScript since it goes from beginner to making projects and it goes through all the concepts you need to know. Python Crash Course does the same and it's more oriented at beginners. Over these two I prefer the former but both are very good.

Also the point of making projects is that you actively put yourself out of your comfort zone, that's the best way to learn. Whatever problem you encounter you can scale down into smaller problems until you get something you can easily understand and solve and that's how you build stuff.
>>
holy FUCK it works
>>
>>100333840
What should i use for image manipulation? Zpng imago?
>>
>>100389104
I have used imago successfully in the past. Make sure to use the jpegturbo/pngio systems too, the default encoders suck.
If you need to access pixels directly, you can get the base data array for super fast access.
>>
File: projectmage.png (85 KB, 767x520)
85 KB
85 KB PNG
https://project-mage.org/Campaign
>>
File: 1616883888996.png (386 KB, 466x466)
386 KB
386 KB PNG
>>100341903
>mfw I work with both Vue and Laravel using Emacs
Native comp btw
>>
>>100391269
The initial marketing campaign for this project must have really connected with people if it still has actual patreon income despite not making progress for so long
>>
>>100391269
>5 months ago
https://sr.ht/~project-mage/
>>
>>100380784
Clojure is basicaly Java with a different syntax.
>>
>>100380871
Low IQ
>lisp and python are very similar
Midwit
>lisp and python are totally different
High IQ
>lisp and python are very similar

You know it to be true.
>>
>>100395093
>sr.ht
Dropped. Jew Segfault can suck my dick.
>>
>>100395340
>Clojure is basicaly Java with a different syntax.
What does that even mean? Java is OOP and Clojure is functional. If I hid the ugly stack traces and the (hopefully) 1% of the code base that is java interop, you wouldn't be able to tell that it was hosted on the JVM.
>>
>>100391269
Talk is cheap. Show me the code.
>>
>>100395380
python is the C++ of dynamic languages. it even has a distinct feature that few other languages can claim: python code written by two different people looks like two different languages. the only others in this prestigious list as far as I know are C++ and javascript

meanwhile lisp, even the bigger lisps like CL, is still uniform, cohesive and clean. even a heavily macro'd lisp still looks like lisp.
>>
>>100395454
LOOP and FORMAT would like a word with you.
>>
>>100395847
they are still just lisp forms. what goes inside them may be confusing, but they're still just sexps in the big picure.
>>
Damn. Copying a region by using the Mark is so much easier on the hands than the bullshit that I've been doing in other text editors for all of my life. I'll take pressing Ctrl + Space once over the holding down Ctrl + Shift bullshit that normal text editors force on me.
>>
Is Org Mode so much better than Markdown that I should learn it? Markdown is second nature for me.
>>
What's the next step after SICP?
>>
I do not know what could have caused my Doom Emacs to not be able to insert emojis using space - i - e.

However it can correctly show emojis in org files.

My fonts config:
(setq doom-font (font-spec :family "Iosevka Nerd Font" :size 13 :weight 'semi-light)
doom-variable-pitch-font (font-spec :family "Iosevka Nerd Font" :size 14 :weight 'semi-light)
doom-symbol-font (font-spec :family "Iosevka Nerd Font" :size 12))


Any ideas? (Any other tip to improve font rendering/looks is more than welcome).
Thanks.
>>
File: insanity.png (85 KB, 947x917)
85 KB
85 KB PNG
>>100396408
For me it wasn't the syntax, but the superior org-mode compared to markdown-mode. Something things are unnecessarily complicated, like quote or code blocks, but you can just make snippets for the most used ones.

Some highlights of Org:
>You can export to lot of formats directly from Emacs
>File-local OR global export and behavior settings
>Superior unordered and ordered list handling
>LaTeX math previews in-buffer (org-fragtog-mode for seamless transitions)
>Can preview linked images in-buffer
>Code regions use the actual Emacs mode for the language
>Tables have superior manipulation
>Tables have a fucking spreadsheet processor integrated https://orgmode.org/manual/The-Spreadsheet.html
>Agenda with todo lists, deadlines
And probably, much, much more. Org is just insane
>>
I'm used to Codium on VSCode and I don't think I want to ever go back, because it lets me write just the first half of every line of code I want to write, and autocompletes exactly what I was thinking 80% of the time. My productivity this year has been incredible so far.
But it segfaults my emacs. I'm thinking about writing my own completion mode with the api they have, also as a way to get my feet wet with emacs hacking.
Do you use any LLM for coding assistance? I like codeium because it's decent and free. Maybe someone here has encountered the issues with it and solved them?
>>
>>100396408
>>100397448
Overall I would say you don't even have to learn much when it comes to syntax, I'd say it's even a bit more intuitive, /cursive/ _underline_ *bold* +Strikethrough+
~inline code~ =inline code2=
* heading
just the links are a bit weirder with [[name][link]] but I never wrote link by hand ever
>>
In the following code from exercise 1.19 of SICP, I understand the math and was able to refactor Tpq(Tpq)) to obtain p' and q', but I don't understand the code itself. I get that we're trying to create an iterative procedure to compute fibonacci numbers, but why the need to check if the counter is odd or even, and why do we take a, b, p' and q' as arguments in the even? case, while we take a, b, p and q as arguments in the other case?
This code is like magic to me, it works but I don't get it, I only understand the mathematical operations but not the ideas behind them.
(define (fib n) (fib-iter 1 0 0 1 n))
(define (fib-iter a b p q count)
(cond
((= count 0) b)
((even? count)
(fib-iter
a
b
(+ (square p) (square q))
(+ (* 2 q p) (square q))
(/ count 2)))
(else (fib-iter
(+ (* b q) (* a q) (* a p))
(+ (* b p) (* a q))
p
q
(- count 1)))))
>>
>>100395454
CL is the C++ of Lisps though.
>>
>>100397661
>=inline code2=
verbatim
>>
>>100397661
>but I never wrote link by hand ever
good evening sir, what needful do you use to make links?
>>
>>100398714
yep, I forgot the name
>>100398853
C-c C-l good sir
>>
>>100397661
It's [[link][name]], you'd know that if you hand wrote it :p
>>
>>100333946
>https://gitlab.com/NalaGinrut/guile-lua-rebirth
Why?
>>
>>100400084
Yeah, you're right, and it explains why it asks for url first.
But this is the reason I love org-mode so much, it's the perfect balance between WYSIWYG and simple plaintext format.
>>
File: JS.png (32 KB, 398x398)
32 KB
32 KB PNG
>>100381840
JSirs... we won...
>>
>>100396408
I use org because it's well-integrated into emacs. I wouldn't bother with it if you're not an emacs user, unless it has specific features that you know you want and can't get in markdown.

Org is more complex than markdown, but it doesn't take much to learn enough Org to achieve what Markdown can do:
https://orgmode.org/quickstart.html
>>
As someone who can write elisp but doesn't really know much about the inner workings of emacs, how would I implement something like "ghost text", sort of what company does when you set company-frontends to '(company-preview-frontend)
>>
>>100403333
I've tried looking at the company source for company-preview-show-at-position and I'm having a bit of a hard time understanding it
>>
>>100403333
>>100403478
Never mind, I figured it out. Creating my own AI completion minor mode as we speak.
>>
File: hobocomputer.jpg (43 KB, 450x276)
43 KB
43 KB JPG
Will the jannies plz unban memesmith? He isn’t taking it well
>>
>>100395380
How can lisp bi similar to python. Python lacks any uniformity commonly found in lisp. If you said forth and lisp are similar sure but python just no.
>>
>>100404215
Got it to work but I just realized in vscode I have full project indexation and no way I’m going to implement that in elisp
>>
>>100405627
isn't that what projectile/project.el are for
>>
>>100405759
I meant codeium on vscode indexes your whole project in a vector database so that the AI is actually useful because it knows your code base
>>
>>100405893
I don't know why you would write that in elisp; it sounds like the job of a server. There must be many repos on GitHub doing this by now that you can just use straight up.
>>
>>100406123
I meant writing the integration with the backend
>>
>>100389761

(ql:quickload 'clx)

(setf *display* (xlib:open-default-display))
(setf *screen* (first (xlib:display-roots *display*)))
(setf *root-window* (xlib:screen-root *screen*))


(defun screenshoot-image1 ()
(car (multiple-value-list (xlib:get-image *root-window* :x 0 :y 0 :width (xlib:screen-width *screen*) :height (xlib:screen-height *screen*) :result-type 'xlib:image-z) ))
)


(xlib:image-z-pixarray (screenshoot-image1))

;; Connection to Emacs lost. [
;; condition: The value
18481451
is not of type
(UNSIGNED-BYTE 24)
when binding LENGTH
;; type: SWANK::SWANK-ERROR
;; style: :SPAWN]


When I execute (screenshoot-image1) it returns some structure. I can access everything by slot value exept image-z-pixarray. If I try everything crashes. Does anyone know why?
>>
I kinda want to go full retard and use Guix as host for my new mini PC (primarily want to use it for firewall) and have OPNsense as a container/VM.

Besides pain, what am I in for? Any tips?
>>
C-h a tells me I can send a word list. What does it mean? Typing
 word1 word2 RET 
never gives me matches
>tl;dr don't know how to apropos
>>
File: apropos.png (26 KB, 979x141)
26 KB
26 KB PNG
>>100407986
I don't know, but this seems to work
>>
>>100408025
I am just stupid them. this works. Thanks sir
>>
Any xref, tag-sisters here? How is your workflow for generating and updating tag files?
>>
I'm reading sicp on my tablet and want to have a scheme interpreter in emacs.
I have the fdroid emacs package and installed geiser and geiser-mit but it says "no such file or directory, mit-scheme" when I try to launch it
>>
Is racket a good scheme? What are the best schemes in your opinion
>>
>>100408066
Yes I do use those
My workflow consists of occasionally calling `projectile-regenerate-tags` (s-p R) manually
>>
>>100408278
as long as the police doesn't catch you, yeah racket is a good scheme. pyramid schemes are also very popular in the scheme community
>>
>>100389070
>tfw in later replaying, the randomness-producing threads die early and result in error due to reloading of messages (including sender information that does not exist)
AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
maybe I just make threads bigint identifiers lololol
>>
>>100409254
>he can't replay concurrent activity
btw, normally the echoLines would not emit (due to being side effects), but that behavior was temporarily disabled for this test
>>
>>100408224
geiser uses external interpreter, it might be easier to use Emacs in termux
>>
>>100408224
>>100410064
geiser is fucking shit, like anon said you'll have an easier time just running a terminal or an eshell window and interacting directly with the scheme. the only one that works reasonably well with geiser is guile
>>
>>100405351
>If you said forth and lisp are similar sure
Lisp and Forth have 0 things in common. You have (maybe) used Lisp to write Fizzbuzz, but you probably don't even know what Forth syntax looks like.
>>
>>100398589
>CL is the C++ of Lisps though.
Anybody who claims this doesn't know either language (in the case of Sepples, however, it's excusable since it's so complex and full of non-orthogonal features that nobody can truly understand it).
>>
>>100410233
I have written both a Forth and a Lisp and you are fucking retarded
>>
>>100395957
Their mere existence, in the standard itself, invalidates your previous claim that
>even a heavily macro'd lisp still looks like lisp.
Everything else you said is just noise.
>>
>>100396307
>bUt WhY dOeSnT eMaCs HaVe CuA bInDiNgS
>>
>>100395380
python is the most perfect example of the bastardization of lisp features. it does have, nominally, a significant number of features from lisp, yet it is nothing like lisp. python is very similar to java in fact, another language whose creators like to say 'it's very close to lisp' but it's definitely not
>>
>>100396416
Actually writing some code.
>>
>>100410270
it doesn't invalidate anything
>>
>>100410256
I have no reason to believe you.
>>
>>100410316
Learn what that word means, Anon. Don't reply until you do.
>>
new to cl. trying to understand this image workflow (sbcl). is it possible to basically record a snapshot of the image in its current state and then reload it later?
>>
>>100410343
The first thing you must learn about CL in 2024 is to NEVER use functional programming, ever, the IRC community said so.
>>
>>100410301
Python is far closer to Lisp than it is to Java and far closer to Lisp than Java is. Only a nocoder contrarian would claim otherwise, 5 minutes of coding in all three languages will make it obvious.
>>
>>100410385
???
python is very much closer to Java than lisp wtf are you talking about
besides dynamic typing and a shitty repl what makes you think they're similar
>>
>>100410428
t. unironic nocoder

Reply no further until you've written anything larger than hello world.
>>
>>100410428
from his usage of the word 'nocoder' you can infer it's a zoomer and probably someone who learned python recently
>>
>>100410385
What an insane take. Even rust by virtue of proc macros is closer to Lisp than python. Dunno how you can claim that py is close to lisp with shitty metaprogramming capabilities
>>
>>100410324
pic related, my Forth
>>100409668
is my Lisp
>>
>>100410510
>Even rust by virtue of proc macros is closer to Lisp than python.
and also because rust is an expression-based language, which is the most fundamental, most basic feature of lisp. rust's macro system is literally straight out of scheme, it's even called "macro_rules" and defined by the docs as a hygienic macro system.
>>
>>100410504
He's a groomcord tranny from /agdg/ who regularly shills his shitty server on /g/. You can spot him by his usage of tranny case, reddit spacing and lingo and general lack of interest in actually learning programming in all of his posts.
>>
Is it unusual that I can't get Corfu to work in Text mode?
>>
>>100405351
Python is much closer to lisp than C, so a Cnile would think they're similar, like a cyclist saying a motorcycle is like a car.
>no explicit typing
>anonymous functions
>lots of list manipulation
>dynamic execution
>package system
>no semicolons
>>
>>100410343
Yes, you can effectively pause execution and then resume it by dumping the image.
It's how most "executables" function in sbcl. It also lets you do things like start sbcl, load all your config settings and libraries, and then dump the image and use it as your standard sbcl executable to effectively load instantly.
There's some stuff that can't survive a save/load but it's not common.
>>
>>100410523
btfo this retard won't address it
>>
>>100411487
that's really cool. what type of thing doesn't survive the save and load? e.g. do you know how similar memory layout and all that is when loading it back?
>>
>>100411434
>no semicolons
lmfao troll confirmed
>>
>>100411266
What the fuck am I missing?
;;Corfu - Autocompletion framework
(use-package corfu
:custom
(corfu-auto t)
(corfu-auto-prefix 1)
(corfu-auto-delay 0.5)
:init
(global-corfu-mode)
(corfu-history-mode))
>>
>>100397953
If you genuinely understand the mathematics, then what you are missing is the beauty of tail recursion.
>>
>>100411753
>If you genuinely understand the mathematics
They're basic as fuck for that exercise. It's just refactoring, nothing more
>>
How the fuck do I have Corfu working for programming language but not fucking Text Mode? It's driving me fucking insane.
>>
>>100411978
corfu is just a UI it's not what causes the prompts to appear
>>
>>100412113
But Emacs already has the prompts built in! C-M-i.
>>
>>100411598
Memory layout is completely destroyed and re-ordered to compress everything, and the process itself is corrupted and has to be halted afterwards, but that shouldn't affect any lisp code. Threads and file handles break, and obviously also FFI. You CAN provide a set of functions that close them before save and reinstate them during load though, it's just more work.
>>
>>100412204
I see, thanks anon
>>
How much ram does the SBCL runtime need? I see it can be compiled for MIPS, wondering if maybe I can make it run on an n64...
Maybe ECL is better for this? What are the ups and downs for each?
>>
>>100412113
Installed Cape and it still doesn't work.
>>
>>100412133
are you sure C-M-i is bound to completion-at-point in text-mode for you? text-mode binds C-M-i to ispell-complete-word by default.
>>
>>100412491
You're right. What am I missing?
>>
>>100412505
make sure cape-dict is in completion-at-point-functions in text mode and bind completion-at-point to whatever you use for completions. I have
(add-hook 'text-mode-hook
(lambda ()
(keymap-set text-mode-map "C-M-i" #'completion-at-point)
(add-to-list 'completion-at-point-functions #'cape-dict)))

in my config.
>>
>>100412391
It's not so much the ram as the size, I don't know how much an N64 can take but absolute minimum we're talking several hundred megabytes.
For something like that you're better off with ecl or microlisp. Or maybe chez scheme, it's pretty damn efficient and fast.
>>
>>100412560
Fucking Hell. Rebooted Emacs so I could try something much like that. Now Eglot is throwing errors. Fuck. I changed nothing but installing Cape!
Error in post-command-hook (#[0 "\303\301!\205\0r\301q\210\304\305\300\242\306#\210
?\205\0\307\310\311 \")\207" [(#0) #<buffer .emacs> eglot--managed-mode buffer-live-p remove-hook post-command-hook t apply eglot--connect eglot--guess-contact] 4]): (wrong-type-argument processp nil)
>>
>>100412560
>>100412598
What the shit. It all suddenly started working. I changed fucking nothing!
>>
Is HtDP a good book?
>>
God I'm so fucking close!
(use-package cape
:init
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-dict))

Corfu seems to get stuck in one of the two modes. It will never suggest items from both.
>>
>>100412569
>several hundred megabytes
why is this the case? is there no way to reduce it? isn't SBCL super old and based off another implementation from the 80s or something? I'm surprised it'd take up that much space.
>>
>>100412874
>Corfu seems to get stuck in one of the two modes. It will never suggest items from both.
completion-at-point by default takes completions from the first capf to return something. you can use https://github.com/minad/cape?tab=readme-ov-file#super-capf---merging-multiple-capfs to merge them.
>>
>>100412920
because lisp is image based, so you carry the interpreter with you or it is already there in the machine. There are smaller lisps and some mad lad used them for embedded shit in norway recently (it was posted here, about a safety system for tunnels)
>>
>>100412966
Thanks anon. Like this?
(use-package cape
:init
(add-to-list 'completion-at-point-functions #'cape-dict)
(add-to-list 'completion-at-point-functions #'cape-dabbrev))

(setq-local completion-at-point-functions
(list (cape-capf-super #'cape-dabbrev #'cape-dict)))
>>
What companies should I look for in Europe if I want to get a job in a Lisp dialect?
>>
>>100413583
SISCOG? They do trains or something, I have this video in my watch later, haven't really seen past 5 mins yet
https://www.youtube.com/watch?v=hMVZLo1Ub7M
There's also some fullstack? Clojure company/startup developing orgPad if I remember, I watched it long time ago
https://youtu.be/4UoIfeb31UU
>>
How can I compile an SBCL program without the interpreter being included in the output?
>>
>>100413846
I think it's impossible to compile without the interpreter, but in chez scheme you can distribute a program without including the compiler
>>
>>100412920
It's the entire compiler, standard library and all loaded files, in source and compiled form, along with all the program state. It's less a binary and more of a complete process core dump. Means it also needs at least that much memory to run as well.
For reference chez can go down to ~3MB for an executable, or potentially even smaller because it doesn't do core dumps and also can strip out the compiler for a much smaller interpreter at the cost of any dynamic code added afterwards will be much slower. In other words it's quite good for an in-game scripting language but you won't be able to completely alter the base game with native performance. SBCL is the opposite, it may be heavy, but it's the ENTIRE dev environment, the executable has full abilities to recompile, redefine, or reset any parts of itself at runtime with no loss of performance.
>>
>>100413846
You can compile the source code down into fasl files, but you'll need an sbcl executable to run them, they're just slightly faster to load and slightly smaller than plain text.
In reality the best way to redistribute CL programs is to just package the source code and have the user run it with their own local implementation.
>>
>>100412391
>>100412569
microlisp is your best bet
>>
>>100413846
use chicken scheme sir, it compiles to C
>>
>>100414274
it still includes the whole interpreter. there's no escaping that. any lisp program needs a lisp interpreter.
>>
some people ITT seem to be under the impression that 'compiles to C' means translating the scheme directly to C. it's not that simple. all the scheme to C compilers still include a decently large library containing the scheme interpreter, and the C it generates is... very unique https://wiki.call-cc.org/chicken-compilation-process
>>
>>100414040
I think one of the reasons rms loves lisp so much is that it's kinda hard to make it "closed source". I know having access to the source code doesn't mean it's FOSS but lisp has an extra level of open-ness. if windows was written in lisp they'd never be able to make it truly proprietary
>>
>>100404456
He can't be here for Maid Day? That's rough
Well, tell him to go watch a movie or something
>>
>>100415224
I mean by very definition CL cannot be made impossible to modify, which is the entire point of open source. If you can run a program, you can go in and redefine anything you want to customize it. You don't even necessarily need the source code, it's just the way image based systems work.
>>
>>100414040
>>100414041
>>100414274
>>100415115
>>100415224
There's no actual way to get rid of the debugging tools/source code?
>>
>>100415421
obfuscation of ASTs is very easy to achieve. the same modificatrion capabilities you speak of may be used to modify the program non-reversibly into something more complex that does the same thing
>>
next
>>100417851
>>100417851
>>100417851
>>100417851
>>100417851



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.