social.tchncs.de is one of the many independent Mastodon servers you can use to participate in the fediverse.
A friendly server from Germany – which tends to attract techy people, but welcomes everybody. This is one of the oldest Mastodon instances.

Administered by:

Server stats:

3.8K
active users

#commonlisp

15 posts11 participants0 posts today

The port of my music player #Benben to #CommonLisp continues... and as of tonight, the original S-Lang TUI interface is working! ​:happyremi: I even managed to fix a bug with the scrolling text fields and Japanese text.

The only C bindings going on here are:
#libxmp (to play the .xm file), libao (final audio output), ZStandard (VGM decompression), and #S-Lang (TUI). The rest is pure Common Lisp, including the DSP effects and #VGM playback/chip emulation.

Normally you launch this from the command line (which is also working), but I did it with Emacs+Slime just to be fancy.

#LinuxAudio

Replied in thread

@simendsjo @jackdaniel #XMPP has all those features, and there's a fairly big #Lisp / #Scheme / #CommonLisp channel there - xmpp.link/#lisp@conference.a3.

It might not have everything that #Discord does, but it's vastly better than #IRC. And there's a cost to using #proprietary and #centralized services, which people constantly forget about in chasing convenience and shiny features.

Here's a guide to help you get started.
contrapunctus.codeberg.page/th

xmpp.linkXMPP Invitation

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

Common Lisp - with its open-source implementation, SBCL, offers greater resilience against US tech export controls and sanctions compared to Go. Its stable, long-lived libraries can be easily archived locally. Go, however, undergoes frequent changes and depends heavily on GitHub, which is a US-based service, increasing its exposure to such restrictions. Furthermore, since our project is non-military, encryption algorithm limitations do not pose a concern for our use case.

Here's a new challenge for Lisp folks to figure out.

Why does this fail. And don't give the error message as the answer. WHY does this do what it does?

(defun who-am-i ()
(flet ((x () 'inner))
(labels ((x () (x))) ;;
(x))))

Is the third line calling inner or itself?

Okay you get one second hint: Yes, it overflows. Why?

That is the challenge.

Kinda nice that my port of my music player #Benben from Crystal to #CommonLisp is now far enough along that I can use it as my daily music player. The only caveat is that I currently have to use a new "Minimal UI" that I implemented as an alternative for v0.7.0. But overall, it didn't take as long as I expected to get it in a usable state ​:happyremi:

I'm definitely not ready to release v0.7.0 yet, though. I'm lacking the entire original UI, VGM support is incomplete, and it's missing a few formats still (Opus/Vorbis, SID). Also, I haven't implemented rendering to WAV/AU yet. But that'll all come with time.

Replied to sigue

@sigue @scream

Oh-kay. I have been foollowing the code down the rabbit hole, and I am a bit out of my depth here, but what I see are two things:

1) (ext:default-directory) calls another function CD, which can change the directory. If without an argument, the argument is created by merging (the non-argument) with defaults and doing logical path translation, then it actually changes the directory and returns the pathname calculated before (the new path to which it changed the working directory).

So querying the default directory comes about as a side effect, sort of.

2) I am not sure about what actually happens in this default thing, but what seems certain, we're afterwards doing a call to chdir(2) every time (which has no effect when the argument is the working directory already except when the dir is unlinked (**)). We would have to call 1 system call anywhere here, but this ... and then I don't know if it doesn't call getcwd anyway in this default/normalizing stuff.

(**) This is a real deal breaker if you think about it: Do a (EXT:DEFAULT-DIRECTORY) and maybe end up in a different directory or even get an error for daring to _query_ the current directory . It's a legal scenario in a POSIX environment to step into a directory, then unlink it (seal your process in).

And the version comes in from the place where the "empty argument" is expanded into a pathname.

I think I'll really be circumventing this all. Instead of UIOP:GETCWD (which calls EXT:DEFAULT-DIRECTORY) I'll just redirect my GETCWD wrapper to (osicat:current-directory). Which, BTW, does the right thing.

But really, I am not sure if I shouldn't try to raise a bug here (not for the implementation, I am understanding it not good enough to judge it, but rather for the spurious :VERSION which also cannot be deleted). Any advise?

Replied in thread

@shapr Tooter (github.com/Shinmera/tooter, by @shinmera) is a Mastodon client library for #CommonLisp. Very scriptable.

I wrote a layer on top of it for more convenience in writing client scripts: codeberg.org/khinsen/malleable

Using these libraries, I consume most of my Mastodon feed as a set of RSS feeds, defined by my own algorithms.

A Common Lisp client library for Mastodon instances. - Shinmera/tooter
GitHubGitHub - Shinmera/tooter: A Common Lisp client library for Mastodon instances.A Common Lisp client library for Mastodon instances. - Shinmera/tooter
Replied to screwlisp

@screwtape

This will sound like sacrilege for #CommonLisp but in #DylanLang I no longer use plain symbols as a poor-man's enum. Instead I do this:

define constant $rock = #"rock";
define constant $paper = #"paper";
define constant $scissors = #"scissors";

define constant <tool> = one-of($rock, $paper, $scissors);

and then type things as <tool> where appropriate. Et voilà, I can no longer misspell symbol names without getting a compiler warning. More importantly, neither can clients of my library.

EDIT: fix Dylan bugs, add last sentence.

Replied in thread

@amoroso #commonlisp #lisp
there is also its "Exotic Language of the Month Club" on page 99: CRL, a knowledge representation language (implemented in Common Lisp). Then the PowerLisp ad on page 62. SCOOPS on page 49ff. The KEEConnection ad on page 23ff. The "Personal Consultant Plus" (written in PC Scheme) ad from TI with support for the TI Explorer Lisp Machine on page 6/7. The GoldWorks ad on page 145. Plus: a bunch of Prolog articles...

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
Continued thread

In 2009, I had to cancel a scheduled keynote talk at the European Lisp Symposium (ELS) in Italy because I was due to be in surgery at that exact time for my thyroid cancer. (Surgery went well, and I've seemed thankfully free of it since.) They were kind enough to ask me to speak in Lisbon in 2010 instead. But I didn't at the time, in 2009, speak publicly about the surgery or the cancer. Instead I made a vague excuse about an illness in the family (not technically untrue) being the reason I couldn't do the talk.

On the evening before the surgery, I wrote a somewhat metaphorically cryptic post to my blog that I figured would at least capture my apprehension in case the surgery did not go well, or even if it did, I suppose. It's still interesting to have a window back into my thoughts.

netsettlement.blogspot.com/200

Back to modern day, I do have a planned procedure (not tomorrow, not dire and far more routine, so not to worry, but please don't ask for additional details just now) that I've been reflecting about just a bit.

Though in all honesty, I and all of us are probably at more risk just walking around on the streets in our emerging fascism (here in the US, though other places are not exactly immune either), and that's on my mind all the time now as well. Any one of us could become an unperson, certainly anyone with decent ethics anyway, as that seems to almost be the criterion for who they're going after.

The tanka I wrote is not specific to one thing in particular, just the sum total of various such things that point to the ephemeral nature of each of our existences.

It's both frightening and infuriating to live in a society where we are at risk merely because of our very existence or nature being seen as a crime.

There may be some among us that don't feel at risk. I wish I could say that's good. But I worry it's obliviousness/denial, or privilege, or something darker, perhaps even being comforted by being on the winning side of bigotry. Maybe give it some thought, because I don't want people to be disempowered by what's afoot, but neither should they feel it's someone else's problem. We have real problems that need to really be addressed. It's a time to feel uncomfortable because no one should be comfortable with what's happening. It's a time for people to empathize and contribute to getting the world back onto an even keel.

Meanwhile we are all individually fragile, too. I had a philosophy class in which the professor told us we could not say with certainty that we would have lunch with someone tomorrow. The future is intrinsically less than certain, we're just talking degree here. But the things going on now are good cause to appreciate those we love, and make sure that we've got things in order in case things get wonky.

And even beyond the politics of the day, the state of climate is dire. I talk enough of that elsewhere, so won't belabor it, but its spectre is ever-present.

Still, it also makes it a time to live, not to put off living to some mythical future time when things will be better. (I wrote a different haiku about that earlier this evening as part of this same pondering.) Let's work toward creating a bright future, but let's also not fail to appreciate that today is all we know we have for sure. Make the best of it. And be the person you want others to remember fondly.

netsettlement.blogspot.comOver the EdgeKent Pitman's blog. Independent, progressive views on Society, Technology, Social Justice and Climate, or sometimes poetry, philosophy, or history.