Salta al contenuto principale


I was too busy to do AOC this month (that's adventofcode.com/).

So I'm thinking I'm going to do AOC 2024, *in 2025*, under the following rules:

- One challenge per week.
- I don't have to perform a challenge every week. The goal is to finish by the start of December.
- I have to do a different programming language every time.
- C, C++ and Objective-C are not eligible languages.
- If I make an honest attempt at a language and fail, I may retry in Go (but only Go) (I need to learn Go)

Questa voce รจ stata modificata (9 mesi fa)

Oblomov reshared this.

in reply to mcc

Bonus rules

- ASM may be used more than once as long as it targets different language families (x86_64, RISCV, ARM, WASM).
- JavaScript and TypeScript are the same language.
- Rust and Unsafe Rust may be potentially counted as two different languages.
- I may use Perl/Python to "preprocess" file inputs into arrays of numbers or strings (but no more complex parsing) in the target language
- If I make an honest attempt at a language and fail, I may retry in Go (but only Go) (I need to learn Go)

in reply to mcc

This is my list of candidate languages. โญ means I feel comfortable and ready to go in the language. โ˜† means a language I've used but am for whatever reason not confident I could do an AOC challenge in. Totally interested in suggestions for languages I am missing from my list, opinions as to whether Scheme and Racket are the same language, etc.

Goal here is personally/professionally enriching language tourism so I can be broad minded I expect. Maybe no intentional tarpit languages this time tho.

Questa voce รจ stata modificata (9 mesi fa)
in reply to mcc

fortran in recent years has gotten a package manager, repl, and jupyter notebook support, so maybe it can fight its way out of the "paleo" bracket
in reply to Joe Groff

@joe I think it would be to my benefit to know how to use Fortran.
in reply to mcc

@joe The nicest thing I can say about Fortran is "At least it's not Cobol" #YMMV
in reply to mcc

Wait HECK how'd I type ALL OF THAT, including the note about "no Objective-C" (reasoning: it's too much C) but forget Smalltalk/Self

Are there any languages I should know about that are like, "Smalltalk is to X" as Erlang is to Elixir or Scheme is to Racket? Or am I just describing Self here. What's a modern Smalltalk environment look like. Is Dave Ungar's magical Self IDE still publicly available. Was it ever public or did you just have to be in that one room in Mountain View in 2004 to see it

in reply to mcc

Pharo feels like the most serious smalltalk environment I've seen in a while (though I haven't looked at it in years).
in reply to mcc

if you're fortran-curious and objective-c is too much C for you, i have good news
Questa voce รจ stata modificata (10 mesi fa)

reshared this

in reply to Joe Groff

@joe
Initially, the Objective part was viewed as a fairly generic integration layer to be added to many languages (see COM and SOM for similar ideas). I distinctly remember an article by Brad mentioning Objective-Assembler and others.

During the NeXT days, this was watered down a little to view Objective-C as a whole as a fairly dynamic target, but still focusing on the OO layer.

Even later, we saw the focus shifting to bridging C. Much harder, less fun.

reshared this

in reply to Helge HeรŸ

@helge maybe there's a happier timeline where the object-oriented hype phase was just people adding Smalltalk on top of every language, instead of whatever C++ and Java is

reshared this

in reply to Joe Groff

@joe @helge Ups, should have answered here: AFAICR, exactly was that the original idea behind Objective-C.

C was just the first target that the Smalltalk OO layer was added to.

reshared this

in reply to Joe Groff

@joe @helge I never looked into Smalltalk deeply enough, but didn't we kind of get that, and that's how we ended up with JavaScript? Or is there more to it than just prototype-based inheritance and a message-passing metaphor to OO?
in reply to lambdageek

@lambdageek @joe JavaScript is prototype based which is pretty cool for such a popular language, it doesnโ€™t have messaging though, which is more important in the
context.
in reply to Helge HeรŸ

unfortunately, I don't feel JavaScript is very good at being a prototype based language. I once wrote a prototype based language (Emily 1+2) and found it a very powerful idiom in that contextโ€” it made me want to try Self. But I've never successfully used prototypes in JavaScript for anything, except that one time I laboriously recreated a class system on top of it and used the classes. The ergonomics of js prototypes are justโ€ฆ weird. You see why ES6 moved away from them.
Questa voce รจ stata modificata (10 mesi fa)

mcc reshared this.

in reply to mcc

@helge @lambdageek @joe so true. The best use I've seen for prototypes is to create mappings that inherit from other mappings, like a linked list of maps you can push and pop from.

Though you can do it in a 40 line class these days

in reply to fabiosantoscode

@fabiosantoscode @helge @lambdageek @joe can you actually do this with a map<> tho or only if you're using the cursed object-based maps
in reply to mcc

@helge @lambdageek @joe you could do it with a linked list of Map<> objects

But cursed objects don't need custom implementations for iteration, get/set, delete, because you just use the native object versions of this.

in reply to mcc

UPDATE:

Yesโ€ฆ

Yesโ€ฆ!!

YES!!!!

f.duriansoftware.com/@joe/1136โ€ฆ


if you're fortran-curious and objective-c is too much C for you, i have good news

Oblomov reshared this.

in reply to mcc

Any idea if it's Fortran 90 or good old FORTRAN 77?
in reply to mcc

PS I'm doing one thread per week on this project, so if you came to just this thread, here's the link to the first week: mastodon.social/@mcc/113743302โ€ฆ


#BabelOfCode 2024
Week 1
Language: Applesoft BASIC

NEXT WEEK: mastodon.social/@mcc/113783248โ€ฆ

"Advent of Code" is an online event where you're given 25 two-part code puzzles, which you're supposed to solve in 25 days in December. I was busy so instead I'm doing a slow-motion, 1-puzzle-per-week version over the course of 2025, but with an added restriction: I have to do it in a different language each week.

@unjello proposed a hashtag, so maybe there are two of us on this
mastodon.gamedev.place/@unjellโ€ฆ
(1/2)


in reply to mcc

As an update on my rules above: I am going to try to restrict myself further so that in addition to doing a different language every week, every language I use in this challenge will be *a language I haven't written a program in before*. I will interpret this loosely; I'd written AppleSoft BASIC but I was six and I my code technically wasn't turing complete; I'd written x86_64 but not full x86_64 programs. If I decide this restriction is more annoying than interesting I may drop it. We'll see.
in reply to mcc

as in "descendents of smalltalk" ? anyway it feels like you'd be a person with dylan on your list of programming languages
in reply to tef

@tef I have wanted to learn dylan for a long, long time. Is it something you can easily run on Linux in the year 2024 tho?
@tef
in reply to mcc

the last release of opendylan was 2024 so
in reply to tef

i have just found out that david ungar of self fame also worked on swift so i felt you should be aware of this as it may impact your ranking above
in reply to tef

@tef โ€ฆ โ€ฆ โ€ฆ this makes me more likely to try Swift
@tef
in reply to mcc

Eiffel is nice for OO. The modern Smalltalk is supposed to be Ruby. I see all languages mostly idempotent. Smalltalk and Ruby are the only ones in which the source code is an object.
in reply to mcc

Objective Smalltalk (yes ๐Ÿ™ˆ) is an outlier but worth a look: objective.st
in reply to mcc

NewtonScript is very Self-y, and I greatly miss it, but I have no idea how to possibly run it nowadays.
in reply to Avi Drissman :vm:

@avidrissman โ€ฆ

โ€ฆ

โ€ฆ

โ€ฆ

This post has reminded me to follow up on that lead I had for buying a used Newton

in reply to mcc

So Squeak is still going strong (caveat: biased opinion), but Cuis and Pharo are also still chugging on.
- squeak.org/
- cuis.st/ (/cc @drgeo )
- pharo.org/
in reply to mcc

@drgeo Yes. I'm part of the core devs, I've worked on a few VMs for Squeak, and some part of my dissertation involved Squeak.
I bought HiDPI to the Squeak VM
in reply to mcc

Self, too, aint dead yet.
It's available at selflanguage.org/
(caveat, I was/am involved there)
in reply to Tobias

@krono I'm interested in trying this, so I know, if I download the 2024.1 release is that going to be a GUI IDE or a command line program or what?
in reply to mcc

It includes the VM and an Image, which has gui capabilites. But give me a sec, I'll check.
in reply to mcc

If I had to guess, a "modern" Smalltalk environment looks like what Dynamicland has been doing with Realtalk (Alan Kay is behind Dynamicland and was the individual who came up with Smalltalk on a dare basically). I got to visit Dynamicland in Oakland several years ago and it was friggin awesome!

6 minute overview video from August 2024: youtu.be/5Q9r-AEzRMA

I guess they're in process of setting up another space in Berkeley now (AFAIK, the Oakland lab more or less closed during the pandemic)? dynamicland.org

So yeah, you might have to be in that "one room" (Dynamicland in Oakland was several rooms) but, that's kind of the co-creating with people in spatial collaboration in essence, or as they term it: "communal computing."

Questa voce รจ stata modificata (10 mesi fa)
in reply to mcc

scala? It has rather dropped out of fashion, but is interesting for the sheer variety of acceptable idioms.
in reply to Tim Panton

@steely_glint yeah, i guess. i'm worried about the size of the environment but if i'm installing java i guess i've already paid for that
in reply to mcc

@steely_glint I only had brief experience with it but it was not significantly worse than doing Java development. Being able to Do Types did not make the experience that much better, though.
in reply to mcc

no opinion as to whether scheme and racket are the same language, but fyi when I wanted to spend a week learning a lisp I ended up choosing racket because its documentation and IDE seemed more complete
in reply to mcc

Definitely oddball ideas, but...

โ€ข Shell languages (bash, fish, nu)
โ€ข Theorem solvers (Lean)
โ€ข F# as another functional language
โ€ข Cranelift IR or CIL for others in the ASM bracket
โ€ข T-SQL...?

in reply to Cassandra is only carbon now

@xgranade Bash was an intentional omission. Not for the same reason as C. I justโ€ฆ I really don't like it. I don't think we should do this to ourselves.
in reply to mcc

I'm with you on that! Just wasn't sure how out there you were looking to go, sorry.
in reply to mcc

Yeah, just as well, I suppose. It had a few interesting new ideas, but didn't seem like enough to justify a whole new language, perhaps?

One other idea: Scala, for typeclass goodness on the JVM.

in reply to mcc

Were I not in a state of distinct mental dysfunction right now, I'd be doing AoC in Forth, so I'd definitely push that higher up the list. It's totally unlike anything else.

I'd also suggest Erlang to go on the list in the "Functional" section. (I'm reasonably capable in Erlang, and I like it).

For a challenge in the ASM section, go old-skool with Z80 or 6502 or 68000? (I've mostly done ARM2/3, and a bit of Z80; 68k looks... hard?)

And maybe a vector language like APL or J?

in reply to Hugo "Dark Satanic" Mills

@darkling One reason I'm a little shy about the "odd" ASMs is I kind of want to only run ASMs on actual hardware, which will be hard with the very old systems.
in reply to mcc

@darkling Also I made an effort to learn Prolog a while back and it's making me nervous about work in APL.
in reply to mcc

My understanding is that Prolog and APL are very different beasts (but I may have misunderstood APL).

Interestingly, Erlang is distinctly (and deliberately) Prolog-like in syntax; less so in operational semantics.

Oblomov reshared this.

in reply to mcc

Fair enough. There's good cycle-accurate emulators that I know of and have used for ARM2/3 and Z80. I also tried Z80 on my SpecNext a couple of years ago. I managed a half day of AoC about every three days real time, and had to stop somewhere around day 4, for non-technical reasons.
in reply to Hugo "Dark Satanic" Mills

I've got access to FPGAs (it's how I'd do RISCV) so I guess I could do something inside of an NES or Game Boy emulatorโ€ฆ
Questa voce รจ stata modificata (10 mesi fa)
in reply to mcc

I've seen a post last week from someone doing this year's AoC directly in Verilog...
in reply to mcc

If you already know Ocaml, it would take you no time to learn Lean. I don't know Ocaml so I can't speak to their differences. But I learned some Lean this year and really like it!
in reply to Daniel Darabos

@darabos @xgranade Okay I'm sorry but I'm confused. Is Lean a soundness prover, a programming lanuage, or what?
in reply to mcc

@darabos It's a programming language and a theorem solver that checks proofs in that language. I'm not sure if it's technically possible to do AoC challenges in Lean, but I have had a lot of fun learning the language through the Natural Numbers Game (adam.math.hhu.de/#/g/leanproveโ€ฆ).
in reply to mcc

@xgranade It's a normal functional programming language. You can do AoC in it easily. But it also serves as a basis for formal mathematics. It has a huge library of theorem proofs.

In other words, you can write a sorting algorithm in it and then in the same file prove its correctness, if you like!

in reply to Daniel Darabos

@xgranade It's bootstrapped: the Lean compiler is written in Lean! So it's definitely not just for mathematics, even if that is its main application.
in reply to Daniel Darabos

@darabos @xgranade Yeah but writing a self-hosting compiler is nearly a freebie for a functional language lol
in reply to Luci Rose

@luci I've tried to learn Erlang beforeโ€ฆ I guess doing both Elixir *and* Erlang would possibly be informative! It seems like Erlang/Elixir are very honed toward online services and offline batch processing, which ALL the aoc programs look like, aren't their forte?
in reply to mcc

@luci I know the person who's making Gleam (oddly enough, via house parties hosted by my non-tech friends), which seems like an interesting stab within that Elixir space.

I can also say that Dart is pleasant to use & completely ordinary, I imagine you will have no trouble doing an AOC with it with no previous experience using the language.

in reply to v

@v @luci i need a bigger hard drive tho first since the distribution method is that one big 1gb tarball sob
in reply to mcc

my suggestions for inclusion are Ada and/or SPARK, and I would like to offer the opinion that Scheme and Racket are different languages because no two Schemes are the same language, however you'd probably want to dive into the "unportable" features to keep it interesting.
in reply to aeva

also "Janet" is a language that I've been told to have a gander at by several people who seem trustworthy so it feels worth mentioning, but I have not myself gandered "Janet" so I can't tell you why you'd want to or nto want to gander "Janet"
in reply to aeva

@aeva Oh, somebody mentioned that yesterday, I should have written it down.

I tried to use Julia once and it was very interesting but I walked away because it turned out to be virtually impossible to embed and as you know that's critically important to me.

@aeva

Oblomov reshared this.

in reply to mcc

@aeva well I a going to suggest Futhark but if embeddability is a precondition I guess that's out too
@aeva
in reply to Oblomov

@oblomov @aeva Futhark, theโ€ฆ proto-Germanic runic writing system?
in reply to mcc

@aeva
Yes-but-actually-no.gif

futhark-lang.org/

It's an ML-style purely functional language that transpiles to GPGPU languages (CUDA, OpenCL) so you can use the GPU without touching C-style stuff yourself.

@aeva
in reply to mcc

For broadening your mind, you should include a logic programming language like Prolog or a Datalog variant, and an array language like APL, J, or K. Not Turing tarpit, but both families are definitely mind-bending.
in reply to Brian Campbell

@unlambda Made a serious intensive push to learn Prolog in 2000. Very interesting, made me want to learn miniKanren. Really do not feel like a week is long enough to do an AOC challenge.

I will consider J/K.

I have been trying to learn to write in unlambda since the year 2001. Still no success.

in reply to mcc

these are varying degrees of cursed:

- prolog
- clingo (or Answer Set Programming more generally)
- blender geometry nodes
- max/msp / puredata
- postscript
- J
- APL
- Uiua

in reply to Na

@na โ€ฆuiua is surprising me, what is this, where does it come from and what use case is it designed for?
@Na

Oblomov reshared this.

in reply to mcc

I would say Clojure is different enough from both other Lisps and other functional languages to be worth including.
in reply to mcc

Racket is a scheme. It has additional features that aren't portable to other schemes, but pretty much all implementations do. I learned MIT scheme, did some racket, and moved to guile to play with Spritely goblins
in reply to mcc

I'd put ONNX and MLIR (and maybe torchscript) in the ASM category
in reply to bob

@bob I haven't tried googling these names yet (trying to catch bus) butโ€” what would you describe the use case of these as being?
@bob
in reply to mcc

I should make a list like this. Since you know OCaml already, I think the big jump to Haskell is monadic IO. IIRC, PureScript is Haskell with row types.

EDIT: Hurr durr also PureScript is eager, which is a big diffrence.

TL;DR: You're well on your way! ๐Ÿ‘

Questa voce รจ stata modificata (10 mesi fa)
in reply to mcc

MATLAB or perhaps APL/J - one of the "everything is an array, actually" languages.

Or perhaps more interestingly Simulink or LabView.

Or Stateflow.

Excel.

GitHub Actions.

in reply to lambdageek

DWARF, ELF, eBPF, Sendmail.cf ("oops, we accidentally a language" bracket)
in reply to mcc

โ€ข Modula-2
โ€ข Modula-3 (the OO one)
โ€ข Oberon
?
in reply to mcc

on a lark today I tried to do yesterday's in hypercard... doable in principle but the lack of performant arrays is a serious performance killer
in reply to mcc

If you put Fortran under paelo languages you ought to specify that it has to be the 77 variant (or earlier if you really want to taste the dust).

With that label even Fortran 90 would, in my opinion, be cheating.

in reply to mcc

you could pretty much write a program in racket *as if* it were scheme, but racket has a ton of libraries and features that your learning goals suggest you should take advantage of. so no, not the same language
in reply to mcc

Forth is great fun for making you break things up into very small blocks., and for making you reinvent the basics. I used to play with it, have failed to pick it up again several times as an adult.
in reply to mcc

Prolog or Picat could be fun *if* you had a problem for which they seemed suitable.

A big ol' SQL like PostgreSQL (or plpgsql if you want) could be enriching and is probably my top suggestion to add. I'm spending a lot of time with it now and there are lots of ways to approach programming problems in PostgreSQL.

in reply to mcc

You could possibly swap in Haxe for Actionscript, it's an open source descendent
in reply to mcc

I notice a lack of Wirthian languages: Pascal, Modula-2, Oberon, heck even Algol-68. Simplicity does not mean a lack of sophistication and powerโ€ฆ
in reply to mcc

Yes, Modula-2 is simple, not designed by a committee. Also, Iโ€™ve written a lot of code in Pascal, Modula-2, and Oberon, and never seen or written any Modula-3.
in reply to mcc

Erlang or Elixir would be a great addition here. Theyโ€™re definitely different enough! Elixir has a lower barrier of entry and feels more modern, though.

And tbh as a former professional CL dev: Common Lisp is definitely closer to Python/JavaScript/etc than to any โ€œfunctionalโ€ language.

in reply to Kat Marchรกn ๐Ÿˆ

@zkat The thing is are elixir/erlang really optimal for batch processing? Cuz that's what these always are, input a file, do an operation, spit out one answer
in reply to mcc

Did somebody already suggest APL? I'd recommend Dyalog APL, which is easy to set up and has good documentation. Be sure to spend enough time on the *very basics*. Programming in APL is... different. But most AOC problems can be done as a oneliner (!).
in reply to mcc

How can you ignore the glory that is PostScript?
Crystal is basically almost-Ruby but way faster.
Scala is a bit more functional than Kotlin but in a broadly similar space (better code than Java but still targeting the JVM); I generally find it quite easy to translate code from one to the other. I would certainly count it as a separate language (no early return).
Questa voce รจ stata modificata (9 mesi fa)
in reply to mcc

I didnโ€™t see anyone mention iolanguage.org/about.html yet. I have no idea how much fun it would be to write within, but it was fun to read about. Iโ€™d place it in the Smalltalk family.
Questa voce รจ stata modificata (9 mesi fa)
in reply to mcc

If you are still looking for suggestions for this list I think you might want to add Prolog since it has a very different flavour to the others. You can sort of see it as answering the question โ€œwhat if a language was built on top of `amb`?โ€ in that the language is built on two main ideas: pattern matching, and finding all possible substitutions that make a predicate true.
in reply to mcc

Remember - x86 and Z80 don't count as two different ASMs. Whereas 6800 and 68000 absolutely do.
in reply to fraca7

@fraca7 I like objective-c but the thing is objective-c is very much C "in the small" and the AOC programs are rarely large enough for the Objective- nature to overcome the C nature. I'll just be writing C.
in reply to mcc

Mmh you have a point indeed; for short algorithmically-oriented programs youโ€™d just end up compiling a C program with an Objective-C compiler
in reply to fraca7

On the other hand youโ€™d be compiling it with 2010-era Xcode, which is the only IDE that is not pure unadulterated evil. Unless you consider Emacs an IDE of course.
in reply to fraca7

@fraca7 Okay so

I designed a language once ( emilylang.org ), and the very earliest experimental version of the interpreter actually was written in Objective-C.

However, it was important to me it work on Windows/Linux! So I tried getting it working with GNUStep Foundation.

This was about 2014. HOLY CRUD, IT WAS HARD TO GET WORKING! I think it turned out to be a tarpit and I ultimately was not able to compile the interpreter. I started over in OCaml.

in reply to mcc

Oooh nice ๐Ÿ˜€ The website seems down though? Or very slow.

I donโ€™t have much experience designing programming languages (save for a few toy ones), but I wrote an LR(1) parser ยซ generator ยป in Python and from what I can gather, the OOP paradigm is not very fit for thatโ€ฆ

GNUStep on Windows definitely looks like an adventure. The ยซ Call of Cthulhu ยป scenario kind.

in reply to fraca7

@fraca7 oh! Hm, I'll have to figure out what's wrong with the domain name. It's just a redirect to mcclure.github.io/emily/
Unknown parent

mastodon - Collegamento all'originale
mcc
@Larry20001 This comment is confusing. Are you a robot?
Unknown parent

mastodon - Collegamento all'originale
mcc
@Larry20001 Okay. Well welcome to Mastodon
Unknown parent

mastodon - Collegamento all'originale
mcc
@aadmaa I did AOC exactly once, I devoted almost the whole month full time to it and I did every puzzle in Rust. It was basically a self-administered Rust bootcamp for myself and was extremely helpful, I think.
Unknown parent

mastodon - Collegamento all'originale
mcc

@unjello Oh, isn't Raku what used to be Perl 6?

I wrote one program in Perl 6 in 2001. I never found out if it worked, because Perl 6 had not released a working interpreter by the time that the university deleted my account and I lost the program.

Unknown parent

mastodon - Collegamento all'originale
mcc
@unjello @lritter @neauoire oh yeah, scopes! I should do scopes
Unknown parent

hometown - Collegamento all'originale
Seitan Lu Linvegan
@unjello @lritter Since you have Oberon, Modula-2, ADA, you'll probably find that modula and oberon are so similar that you won't see a difference much, I'd recommend throwing Occam in the mix instead of modula-2.
in reply to mcc

if you have questions, need help or generally want to complain, i recommend our discord
Unknown parent

mastodon - Collegamento all'originale
mcc

@unjello OK so I'm starting on this today!

mastodon.social/@mcc/113743302โ€ฆ

Question: should I label this as BabelOfCode 2024 (because they're the 2024 puzzles) or BabelOfCode 2025 (because we're doing it in 2025?). I went with 2024 for nowโ€ฆ


#BabelOfCode 2024
Week 1
Language: Applesoft BASIC

NEXT WEEK: mastodon.social/@mcc/113783248โ€ฆ

"Advent of Code" is an online event where you're given 25 two-part code puzzles, which you're supposed to solve in 25 days in December. I was busy so instead I'm doing a slow-motion, 1-puzzle-per-week version over the course of 2025, but with an added restriction: I have to do it in a different language each week.

@unjello proposed a hashtag, so maybe there are two of us on this
mastodon.gamedev.place/@unjellโ€ฆ
(1/2)


in reply to mcc

if you need an easy week you can try REXX. Very popular scripting language on the mainframe.
in reply to Paul Will Gamble ๐Ÿ‡จ๐Ÿ‡ฆ

@paulywill as far as I know no, actually. It's like an early perl, or a pre regexp regexp. Extremely powerful text transformation language that looks like line noise.
โ‡ง