rml,
@rml@functional.cafe avatar

The worst advice I was ever given by a professor is that Gang of Four is the only programming book worth reading. After that, its just a matter of practice 🙃

llewelly,
@llewelly@sauropods.win avatar

@rml I have a 1996 vintage copy of Design Patterns in my boxes somewhere. In the 1990s, that was one of very few places to find good information on using patterns in computer software, and that made it stand out in that era. But by about 2005, good pattern tutorials were so widespread that specific book wasn't important anymore. I don't know if I'll ever get back into programming again, but if I do that book probably won't make my list.

rml,
@rml@functional.cafe avatar

@llewelly design patterns is the book im talking about 😆

Its a good book to understand how most software of the past 30 years has been written. But im not convinced we should continue writing software like that.

And it also teaches you the wrong OOP. but it works, in a nightmarish sort of way.

llewelly,
@llewelly@sauropods.win avatar

@rml
I guessed as much, but calling "gang of four" has always bothered me. I'm not sure why.

their approach to OOP was constrained by the languages they were using when they wrote the book in about 1995. Those languages changed greatly even in just the next 5 years. To me it's very weird to hear that the book stayed relevant (in other than a historical sense) for 30 years.

rml,
@rml@functional.cafe avatar

he is one of the founders of bandcamp, actually. they were just starting it at the time, and then it blew up, so ofc I took his advice seriously.

same guy who was adamant that C and C++ are the only serious programming languages, which I took as a simple fact until ~7 years ago, unfortunately.

once he threw a house party, and there was a half-finished bowl of Fruity Loops in his bathroom on the toilet mantel.

rml,
@rml@functional.cafe avatar

actually come to think of it, "use C++" is even worse

rml,
@rml@functional.cafe avatar

I am glad that I "learned" c++ tho, just because it is so diffuse. a major downside of C++-hating is that lots of people exposed to FP early-on will avoid C++ like the plague. which you should, when it comes to building anything new. but knowing your way around is hugely beneficial.

PaniczGodek,
@PaniczGodek@functional.cafe avatar

@rml I think studying C++ should be to CS students what Roman law is to law students (and as such, I don't regret having spent time learning it)

ramin_hal9001,
@ramin_hal9001@emacs.ch avatar

@rml C++ was one of the first languages I ever learned as a kid (my first was BASIC of course), and the first compile language I ever used. For that I am thankful, because I got it out of the way early on.

Much of the machine learning realm and GUI and visualization realm are still stuck on it though, so until generative AI can translate the many billions of lines of C++ code to a better, more function language, we are really stuck with it.

rml,
@rml@functional.cafe avatar

@ramin_hal9001 yeah, I never learned BASIC unfortunately. C++ was the first language I started "fucking around with" when I was in middle school, upon discovering that you can download the source code to lots of software and change what its called, and the fonts and stuff, and rebuild it as "Blakiez Audacity++", and the only programming book I read before college was HACKING: The art of exploitation, which introduced me to Linux and some assembly concepts. but the first language I really got into was , because I wanted to be the next autechre at the time, and then went on to double major in new media art & philosophy at Bennington College. and basically anything you want to do for production-scale new media installation requires openFrameworks, a C++ framework.

but BASIC seems like a pretty good language for young people to learn. easy while reasonably low-level, facilitating the creation of interactive applications quick. I think these days, the best thing can do for a kid interested in programming is to buy them HTDP with , because its both gentle enough to not scare them away, while still going deep.

I also think I would have really fallen in love with programming as a kid had I been given a copy of "Starting ". Forth would have really hit all the right buttons for me when I was young, when I loved just exploring low level stuff with no idea whats going on, just because it seemed so mysterious and weird.

ramin_hal9001, (edited )
@ramin_hal9001@emacs.ch avatar

@rml oh wow, Pd! I have wanted to play with that more, but I just don't have the time. And there are so many modern alternatives now, with things like the Blender node editor and the CSound Cabbage node editor that it seems like it wouldn't really be worth the time except for nostalgia value.

I probably would have really liked Forth as well, had I learned about it earlier. I also really loved BASIC for the Texas Instruments TI89 calculator, but I would have used Forth had there been an option for it, because RPN calculators are so cool.

For my kids, I have introduced them to the Snap visual programming language, which is like Scratch but more functional in nature, it lets you "build your own blocks," (meaning procedures). I also have a copy of "Realm of Racket" ready for when my son is old enough and when he might first express interest in Racket programming. But I'll have to learn more about it myself first.

rml, (edited )
@rml@functional.cafe avatar

@ramin_hal9001 nice, I hadn't seen cabbage before. But yeah, Pd is pretty bare bones. I used to be a power user, which I think is the most advanced implementation of visual programming to date, both in the ridiculously customizable development environment that allows you to design GUIs, and with all kinds of interesting debugging tools and the low level gen~ languages that include a jit compiler that allows you to do signal manipulation with the per/sample precision needed to implement zero-delay filters (which are necessary for producing nonlinearities in signal harmonics characteristic of studio analog tape echoes), an area of programming where the stop-the-world effect of garbage collection rules out most high-level languages.

Its really such an amazing system, and something would GPL if they knew whats good for them; too much incredible software has been created in Max by important artists and composers to keep it from the world, and Max is being held back by keeping it under the control of . C74 should become the cycling74 foundation, then Max could explode, C74 folks could keep their jobs, and Ableton would get integrations with the massive realm of FOSS software by way of Max's expanded reach and rapid development that comes with a free and open source project. And they'd be able to direct a non-profit foundation, which would expand their reach as a company significantly.

I had to stop using it because its proprietary nature creates to many hurdles in the Max SDK to keep up with the rest of the world at the required pace to deliver interactive installations to production events. Jitter in particular is stuck in the stone ages, only reaching openGL 2 with gpu accelerated instancing in like 2017, something I needed in 2010.

I like ableton, ive met Robert Henke and am an old monolake fan. But I hope they can, as artist, think about how important Max has been in art and how it shouldn't remain locked down. Ableton fine, idc, musicians don't share their arrangements anyway. But Max was always this pretending-to-be-open project. It should finally become one.

rml,
@rml@functional.cafe avatar

@ramin_hal9001 perhaps you should show your kids Alyssa Rosenzweig's Scratch NES emulator

alexshendi, (edited )
@alexshendi@rollenspiel.social avatar

@rml @ramin_hal9001

Frankly, is the most boring programming book I can think of.

rml,
@rml@functional.cafe avatar

@alexshendi @ramin_hal9001

I mean, I totally agree, to be frank. I never got further than the first chapter, I can't stand books that want me to create a little spaceship game lol. but for kids it seems great, and given Alexis King's praise, it seems to introduce the right ideas.

I'm a SICP-lover to the core, but if you would have handed it to me at 15, my eyes would have glazed over at the first difficult exercise, which to my memory is the one the one that demands you perform the substitution model for to show that not all total functions are primitive recursive, aka ackermann's function, which asked within the first 10 pages of the first chapter iirc. when I was kid, I needed to be able to create things to take interest.

alexshendi,
@alexshendi@rollenspiel.social avatar

@rml @ramin_hal9001

I think you are confusing it with "Realm of Racket". Here's the TOC of :

https://catalog.lib.uchicago.edu/vufind/Record/11706610/TOC

No spaceships there ;)

rml,
@rml@functional.cafe avatar

@alexshendi @ramin_hal9001 nope, its HTDP, I haven't looked at Realm of Racket
https://htdp.org/2023-8-14/Book/part_prologue.html

alexshendi,
@alexshendi@rollenspiel.social avatar

@rml @ramin_hal9001

OK, I stand corrected. Someone was wron on the Internet.

pkal,
@pkal@emacs.ch avatar

@rml @ramin_hal9001

but BASIC seems like a pretty good language for young people to learn

Perhaps not that bad if you ask Dijkstra:

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

-- How do we tell truths that might hurt?

mzan,
@mzan@qoto.org avatar

@rml

> same guy who was adamant that C and C++ are the only serious programming languages,

The error is thinking that there can be only one programming language. Obviously, it is better reducing the number of PL and paradigms, but one is not the optimal 🙂

There are successful commercial software analysis tools written in Prolog. Many theorem provers are written in FP languages. Many workflow jobs that run on the cloud are written in Go. Rust is used for multithreading code with manual memory. Ada and Spark are used in operational software where there must be some proofs. Erlang is used for distributed services. Etc...

These are serious systems, used in production. If you try to rewrite them in C++, probably you will fail, because the task is enormous without using the proper PL for the specific domain.

@ramin_hal9001

hayley,
@hayley@social.applied-langua.ge avatar

@mzan @rml @ramin_hal9001

> The error is thinking that there can be only one programming language.

There can, but it's definitely not C++; despite attempts of the committee to ape from every language in existence.

mzan,
@mzan@qoto.org avatar

@hayley

you can use one PL, but not one paradigm and not one run-time. At a certain point you had to introduce Actor semantic if you want to manage complex distributed systems, or logical programming if you want to specify complex business rules, and so on. In the end you have many PL paradigms, using more or less the same syntax. It is the Common Lisp approach.

@ramin_hal9001 @rml

screwtape,
@screwtape@mastodon.sdf.org avatar

@mzan
are you saying that Basically The Good Algorithm Here mostly has one, or a few quite analogous approaches to implementation? But I'm supportive of DSLs and the MOP in common lisp. Or [I forgot the punny name of Kiczalez' implementation of MOP for schemes] for rml and ramin
@hayley @ramin_hal9001 @rml

zardoz03,
@zardoz03@mastodon.online avatar

@screwtape @mzan @hayley @ramin_hal9001 @rml
is it tinyCLOS ? idk about MOP for schemes beyond tinyCLOS.

rml, (edited )
@rml@functional.cafe avatar

@zardoz03 @screwtape @mzan @hayley @ramin_hal9001 theres tinyCLOS, GOOPs in guile, chez has a minimal object system which I believe is integrated into its record layer providing interesting properties, i think chicken has ''coops" or something like that, and AFAICT has the slickest object system of any scheme today, which the record system is implemented in which fwiu has some useful properties.

ramin_hal9001,
@ramin_hal9001@emacs.ch avatar

@screwtape @mzan @hayley @rml for what it's worth, I don't like the idea of using lots of runtimes, it increases complexity, attack surface, opportunities for bugs.

But I do agree that you can't just use one. There are times when you really do need an interpreter, and times when you really do need good single-threaded performance without garbage collection, and times when you really do need massive networks of objects with asynchronous object passing, and times when you need good performance measurements and instrumentation, and so on.

That said, I see no reason why all of these different runtimes couldn't be implemented in a version of Lisp that used Rust-like memory management, with the higher level parsing and intermediate language representation implemented in an ordinary garbage collected Lisp.

rml,
@rml@functional.cafe avatar

@ramin_hal9001 @screwtape @mzan @hayley

part of what I like about scheme is the fact that there are implementations for nearly every niche. and the idea that learning one scheme doesn't mean you'll understand others is wrong I think. if you spend a year in r6/r7rs, you'll be able to dive into others. for that reason I've started doubting whether the usual advice to start with guile is the right advice, its too non-standard.

xkummerer,
@xkummerer@chaos.social avatar
rml,
@rml@functional.cafe avatar

@xkummerer @ramin_hal9001 @screwtape @hayley I really need to play with s7, the problem is whenever I do DSP audio stuff these days I reach for Faust, which slaps pretty damn good

xkummerer,
@xkummerer@chaos.social avatar

@rml @ramin_hal9001 @screwtape @hayley I love faust too

rml,
@rml@functional.cafe avatar

@xkummerer @ramin_hal9001 @screwtape @hayley for anything that doesn't get into spectral synthesis territory, its just so damn good. you can pick up the signal graph of any filter and just implement it, usually in less than 10 lines of code. its one of the best examples of an DSL I can think of.

rml,
@rml@functional.cafe avatar

@xkummerer @ramin_hal9001 @screwtape @hayley and plus it compiles to libraries or extensions for nearly every DSP language or audio DAW. its so productive its insane.

xkummerer,
@xkummerer@chaos.social avatar

@rml @ramin_hal9001 @screwtape @hayley plus writing a new wrapper is so damn easy

xkummerer,
@xkummerer@chaos.social avatar

@rml @ramin_hal9001 @screwtape @hayley

"It exists as just two files, s7.c and s7.h, that want only to disappear into someone else's source tree. There are no libraries, no run-time init files, and no configuration scripts."

rml,
@rml@functional.cafe avatar

@xkummerer @ramin_hal9001 @screwtape @hayley yeah, I there is s7 for Pd now, and the author told me that integrating it was as easy as can be.

screwtape,
@screwtape@mastodon.sdf.org avatar

@ramin_hal9001
I can't see that rust-like memory management could be important. You mean you want a compile time garauntee from the compiler that no consing is happening in this block? I don't think it's that hard to write sbcl code that doesn't cons: But garbage collection is fundamentally good.
@mzan @hayley @rml

ramin_hal9001,
@ramin_hal9001@emacs.ch avatar

@screwtape @mzan @hayley @rml garbage collection is good, except when you want to write operating system kernels, especially for real time applications. For OS applications, I think it is better for the compiler be able to provide some guarantees that memory isn't just being allocated on the heap without being able to prove some programmatic path exists to the end of life of that allocation.

I haven't tried playing with it yet, but I understand that PreScheme which was a subset of Scheme used to compile the Scheme48 compiler, is a non-garbage-collected Scheme that you might be able to use to program an OS microkernel.

hayley,
@hayley@social.applied-langua.ge avatar

@ramin_hal9001 @screwtape @mzan @rml

> except when you want to write operating system kernels

The Biscuit kernel written in Go suffered a maximum pause of 110µs. Nor do I want to write OS kernels - Dan Ingalls said that there shouldn't be an operating system.

> especially for real time applications

1978 called, wants its real time GC back: https://plover.com/~mjd/misc/hbaker-archive/RealTimeGC.html

> For OS applications, I think it is better for the compiler be able to provide some guarantees that memory isn't just being allocated on the heap without being able to prove some programmatic path exists to the end of life of that allocation.

I don't care.

> PreScheme

...it is in name only, for it is neither Pre- nor Scheme.

> That said, I see no reason why all of these different runtimes couldn't be implemented in a version of Lisp that used Rust-like memory management

And Lisp that would be in name only.

rml,
@rml@functional.cafe avatar

@ramin_hal9001 @screwtape @mzan @hayley @awkravchuk

what do you think about the ephemeron-guardian-weak pairs trifecta for manually managing memory in a garbage collected language? I've just started playing with it in chez, but havent thought of a good test case for it yet.

also how does SBCL memory management work? for some reason I think I recall that much of its tooling for bare bones bit twiddling resides on the FFI side of things, but its quite sophisticated, with FFI not specifically being tied to interfacing with other languages.

mzan,
@mzan@qoto.org avatar

@rml

you are lucky: @hayley worked on the SBCL GC, so she can answer.

My 2cents are that, apart the GC, CL gives you a lot of power for optimizing memory management because: with MOP you can customize the memory layout of CLOS objects; if performances are important, you can work on big-chunk of data, stored in arrays, and here CL can give you a lot of options for specifying their format. In both cases, you are reducing the work for the GC, because you have less objects, and you can control (at least partially) how they are stored.

It is a lot of power, that few PL offers.

@ramin_hal9001 @screwtape @awkravchuk

rml,
@rml@functional.cafe avatar

@mzan @ramin_hal9001 absolutely agree with this.

screwtape,
@screwtape@mastodon.sdf.org avatar

@mzan
THERE CAN BE ONLY two compiler traditions, interlisp and maclisp
I completely disagree that every language has its day.
@rml @ramin_hal9001

petealexharris,
@petealexharris@mastodon.scot avatar

@rml A metaphor for the C-based languages' memory hygiene.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ethstaker
  • DreamBathrooms
  • InstantRegret
  • tacticalgear
  • magazineikmin
  • Youngstown
  • thenastyranch
  • mdbf
  • slotface
  • rosin
  • modclub
  • kavyap
  • cubers
  • osvaldo12
  • JUstTest
  • khanakhh
  • cisconetworking
  • Durango
  • everett
  • ngwrru68w68
  • Leos
  • normalnudes
  • GTA5RPClips
  • tester
  • anitta
  • provamag3
  • megavids
  • lostlight
  • All magazines