mathstodon.xyz is one of the many independent Mastodon servers you can use to participate in the fediverse.
A Mastodon instance for maths people. We have LaTeX rendering in the web interface!

Server stats:

2.9K
active users

#sbcl

0 posts0 participants0 posts today

Lisp sucks. Tell me what's wrong here:

(DEFVAR x 0) ; GLOBAL BADNESS STAYS

(DEFUN dO-StuFf (NUMBer)
(LET ((rEsUlT 1))
(DECLARE (SPECIAL X)) ; THIS IS LEGAL HERE
(SETQ X NUMBER)
(TAGBODY
StaRT
(IF (< X 1) (GO ENDz))
(SETQ rEsUlT (* rEsUlT X))
(SETQ x (- x 1)) ; NOTE: STILL USING GLOBAL x INSTEAD OF LOCAL X
(GO StARt)
ENDz)
(pRiNt (lIsT 'FACtoRiAl-oF NUMBER 'iS rEsUlT))))

(DEFUN nOW-dO-AlL ()
(LET ((I 0))
(LOOP
(WHEN (> i 5) (RETURN))
(Do-sTUFF i)
(SETQ i (+ i 1)))))

(nOW-dO-AlL)

#commonlisp #lisp #sbcl #clisp @amszmidt @screwtape

Some important acronyms to know. Feel free to add some of your own.

Lisp:
Logic In Symbolic Paradigms
Lisp Inspires Strange People
Lisp Is Secretly Perfect

Python:
Pseudocode You’d Teach Hordes Of Newbies
Probably You'll Try Harder On Next-lang
Python: You'd Think Hardware's Optional Now

Emacs:
Editor Maintained As Community Shrine
Ecosystem Mainly Acquired by Cult Sysadmins
Emacs Means Always Configuring Something

Vim:
Vaguely Interactive Misery
Very Irritating Macros
Vim Isn't Modern

Linux:
Legendary Interface, Notoriously Unforgiving eXperience
Loyal In Nature, Unmatched eXtensibility
Linux Is Natural Under X

#emacs#vim#linux
Replied in thread

@Regenaxer @borkdude @vindarel Thanks! Right, so my comparable in-REPL times for iterative factorial 1000 are

#PicoLisp: (bench (apply * (range 1 1000)))
0.000 sec
#Clojure: user=> (time (apply *' (range 1 1000)))
"Elapsed time: 2.428199 msecs"
#SBCL: CL-USER[1]: (time (apply #'* (alexandria:iota 1000 :step 1)))
Evaluation took:
0.000 seconds of real time
0.000015 seconds of total run time (0.000000 user, 0.000015 system)
100.00% CPU
45,990 processor cycles
0 bytes consed

Replied in thread

@lxsameer There are a lot of things I like about it. This is a great question, 'cos everyone will have different answers. I have a few, so hopefully I'm not just duplicating them.

I started on it a long time ago, using clisp, but took a long break. But what brought me back was remembering how I could easily talk my way through the code, to describe verbatim what it does. I got into sbcl because it is obviously more refined, but I still use clisp for anything quick I want to accomplish.

People complain about the parenthesis, but doing so ignore all the curly { and same number of () all over their code of choice. I like that Lisp's parens do not get in the way of reading what the code does. Don't listen to anyone complaining about parens, unless their language manages without some sort of equivalent. None of them do. It looks different, but hell, Python looks super weird, overly long and skinny, and everybody loves it.

To me print(something) is disruptive. (print "something") is not. Especially if that print("something"); has that semicolon on the end. wtf is that for? And this increases when "something" should be a function to output whatever that something is. In Lisp, it's pretty slobberproof, and still only takes the one line you started with (unless you WANT to make it pretty ans split it out).

I like that if I don't quite know how to do something, but I know how to start it, I can fudge my way through by writing the function, and the parts I don't know yet are just other functions I haven't written yet. I can then work on those functions after I am done writing the main thought I had. I can even make those uknowns a placeholder providing a fake output if I need to, and then they are right there ready for development once I get to it. Unlike some languages, the functions don't necessarily all become function calls, so eventually it becomes efficient while still being quite readable.

So many things. I simply can't think that way in C. I suppose I could, but all those damn ; are there, and other finicky things that get in the way of creativity when they don't really need to be there. Just a set of () around every separate thing.

Some tags to help with exposure (look upward in the thread if you got here because of one of these tags):
#lisp #commonlisp #scheme #clojure #sbcl #clisp

I wrote a better #medium #tutorial #article #parody of #python #programming #tutorials in which I hilariously misunderstood python to be a reference to #sbcl #commonLisp #lisp (heir to CMUCL python).

medium.com/@screwlisp/this-is-

I also address two fascinating medium trends I discovered.

1. The intense swapping-whispered-ghost-stories about lisp by scientist writers

2. Most articles named "Free Python Tutorial!" have no code, but links to purchasing training.

I eventually found "11 one-liners"

my current little joys besides my family and kids are. Books about #lisp, common lisp itself with #sbcl, #xfce , #linux #debian and old school server side rendered #web sites. And all the web standards there are like html css and js. We have come a long way to have those great tech that lasted so long. I'm really thankful for all those projects and effort that got into it. Please lets make those tools accessible for everyone and simple in design. All that comes after us will have a bad time if we embrace all this complex cloud and build tools to just build simple software. Software is made for humans not mashines. Thanks for listening stay safe enjoy life and the little things and all that is.

🔥 🚀 #hackernews now runs on #SBCL

> I've been working on an implementation of Arc in SBCL which is much faster and also will easily let HN run on multiple cores. It's been in the works for years, mainly because I rarely find time to work on it, but it's all pretty close to done.

[dang, 2022]

> The production website of HN now runs on top of SBCL (I've got the confirmation from one of the moderators). It uses Clarc, an Arc implementation in CL.

[/u/lispm, 2025/01/31]

I dove into the #SBCL #lisp compiler’s internals today for a course. It’s amazing what you can learn in a single day of research with a proper goal. Although a semester of compilation courses prepared me for this.

I think I’ll dive into the #FreeBSD kernel during winter break. I already know the structure as I’ve debugged my kernel a few times.