c.im is one of the many independent Mastodon servers you can use to participate in the fediverse.
C.IM is a general, mainly English-speaking Mastodon instance.

Server stats:

2.9K
active users

#Lisp

78 posts57 participants1 post today

I've been an #Emacs user for like 20 years because there was one thing I needed to do back then that was made easier by elisp, and I just got used to using it. In all that time, I hardly ever tinkered much with the config, save a few minor tweaks it was pretty much stock. I had no strong feelings about Emacs in general, it was just the text editor I'd grown comfortable with.

I've recently been diving into #Lisp and poking around with my Emacs config, and after all these years, I think I'm starting to get the appeal. I am still a proponent of "use the tool that works for you", but I'm personally firmly on team Emacs now.

Lisp Fun. A mathematical oddity.

Some numbers, when multiplied by consecutive numbers, produce a bit of a cycle. Try this code and notice that all the answers are permutations of the same number, 142857.

(defun cycle-142857 ()
"Prints the magical 142857 × 1..6 cycle."
(let ((n 142857))
(format t "~%Watch this cycle:~%")
(loop for i from 1 to 6 do
(format t "~d × ~d = ~d~%" n i (* n i)))))

When you've exhausted your fun running it, increment the number to see what 142857 * 7 gives you.

The original #LISP had 7 primitives: \(\texttt{cons}\), \(\texttt{car,}\) \(\texttt{cdr}\), \(\texttt{atom}\), \(\texttt{quote}\), \(\texttt{eq}\), and \(\texttt{cond}\). And the original #Smalltalk syntax could fit on a 5×7 card. That meant a novice could learn the syntax in a matter of minutes, and direct all his efforts to learning how properly to wield the power of that Turing-complete language. This was why, in the 1970s and the 1980s, many college freshmen were taught FP in Scheme (a more modern LISP) and many middle school children were taught OO in Smalltalk. These were surely the best "first" #programming languages.

#FORTRAN and #BASIC were simple, too. FORTRAN, the first high-level language, has been in continuous use since the late 1950s by engineers, who are not keyboard warriors. BASIC was invented in the early 1960s for teaching programming to non-STEM students at Dartmouth. It sired a whole generation of self-taught children in the 1980s.

Compare those to C++, Erlang, Python, Haskell, Java, JavaScript, Scala, Rust, Kotlin, and pretty much every language in popular use today. Most consider Python and JavaScript to be the simplest of modern languages. Yet, they are massive, complex languages. No 10-year-old could teach himself those, nor should he.

The original versions of those classic languages cannot be used to solve modern problems. But they should still be taught to youngsters as their first language. Throwing in the kids' faces a modern enterprise language confuses them and discourages them. Consequently, many novices never attain that state of flow, when the joy of programming gushes forth.

#Simplicity is a virtue.

fedi help a doll (& US citizen) out, I have a dilemma. Do I go to this #lisp conference in Zürich giving me a chance to make connections in safer parts of the world, or do I stay in the bay area and not risk dealing with border stormtroopers on the flight back? I've got my old pronouns on all my docs 🥺

While I don't use #lisp as a primary language for anything I do, and I'm not as fast in it as any other language... i do find myself getting unstuck in other languages by saying "Okay, if I were doing this in LISP, how would I do it?"

That's the main advantage to knowing more programming languages.

Replied in thread

@praetor @SDF @screwtape Since you are now blessed with the #lisp bug, you should check out NetLOGO3D. It's not your grandpa's LOGO.

NetLOGO and NetLOGO3D is a multi-agent LOGO, which means you can control thousands of turtles individually. It's used a lot in swarming demos. (Multi-agent programming)

There is a web version, which I linked an example below. Click one of the setup- buttons, then Go. Click Go again to stop it, and other setup- buttons to change the form.

The local NetLOGO3D app, if you install it, lets you click and drag the 3D box around like a normal 3D app. I guess on a web page that's a lot more resources. It also comes with several hundred NetLOGO and NetLOGO3D models for just about everything in physics and maths.

This one just spins a 3D shape around. Check out the code at the bottom menu. It looks like your grandpa's LOGO, but way more cool.

netlogoweb.org/launch#http://c

www.netlogoweb.orgNetLogo Web