« Oatmeal

Tagged "programming language"

Follow this tag

Occasional notes

If they aren’t weekly, I guess they’re occasional?

3rd repair procedure to fix brain bleed was a success. I have a few more scans and follow ups, but, knock wood I think I’m through at this point.

I’ve spent about a week laying low and taking it easy navigating some wild pain, but that is subsiding now. I watched a bunch of stuff. It was a nice change of pace. I don’t typically watch much television or many movies. Stand outs (all things I revisited) include:

  • Michael Clayton
  • Point Break, the original one
  • John Carter of Mars, straight up…this movie is awful. The book is pretty awful, too, but they just don’t make bananas sci-fi like this any more
  • Bee and Puppycat, this one was weird — I’d seen it all through and loved it…I was surprised to see how different the Netflix version is from what I remember.

I’ve continued reading about and exploring some array programing languages. I find them fascinating. I doubt that I’ll ever do much with any, but they’re fun to think through and make me wanna play with combinators in other settings…also, matrices.

Another language recently stumbled on is lil. It is a scripting language baked into a cool little project called Decker. Learn even more about it.

The language is strange, and exciting — it allows for some interesting combinations of imperative, functional, and array programming styles.


No doubt ya’ll have heard about the goings on at Twitter. I haven’t been on Twitter for years, but do love myself some fediverse-action. Lately it has been getting some attention.

A cool mastodon trick for anyone wading into the waters for the first time:

I’ve used the fediverse for years and ended up moving from server to server a few times. It is useful to have a quick shorthand for folks to find you without always giving them your exact handle — if you have your own website you can use that as a form of identity without needing to host your own server!

To pull this off you need to add a file at <your personal domain name>.tld/.well-known/webfinger

Paste the contents of https://<name of mastodon instance>.tld/.well-known/webfinger?resource=acct:<your user name>@<name of mastodon instance>.tld into the webfinger document on your server. From there, you are cooking with fire!

You can then search for fedi@eli.li and your main account will show up in the results. It is sort of like an alias.

NOTE <anything>@<your domain>.tld will trigger this. As far as I know there is no way to lock it to a specific handle, since, this isn’t really a feature as much as an easily exploited bug of the lookup system.


No super notable links of late. On a meta note I use pinboard.in to collect and organize links; I’m growing a wee bit concerned about pinboard is withering on the vine. I recently tried to export my gigantic archive from it and…no dice? Days later I emailed support and no response. Anyone have favorite alternatives? Either pay-for, or self hosted. Ideally I’d like it to be able to grab the linked content. I’ve used wallabag in the past and wouldn’t mind returning to it, I’ve just been slowly trying to back away from self hosting services and pinboard seemed oh so reliable when I moved to it a few years back.

Introducing Guava

I’ve been fascinated by Forth and concatenative programming for a while now. I can’t remember how I initially stumbled in to it, but once I got going I’ve been unable to stop. I’m a wee bit in love with it.

Wanting to play a bit with implementing my own spin on things and having opinions about tooling, I picked up a little scripting language called Ripen, by Felix, and started to extend it. I call the results Guava.

Guava

Guava is a stack-based, concatenative language and editor for the browser intended to be used for scripting and as a DSL for small web projects.

It is a toy for exploring concatenative language design, and the DOM. It could also easily be used as a scripting interface for a larger project. It is likely to change a bit over time, and is by no means done — but I think it is in a pretty decent state for a toy to draw to the DOM.

Guava supports arithmetic, control structures, basic DOM manipulation, object parsing and very simple HTTP requests (GET and POST).

Guava is an unusual language inspired by other unusual languages. While not strictly necessary, being loosely familiar with Forth is helpful when playing with Guava. Guava isn’t a Forth, but it is closer to a Forth than it is to something like JavaScript, C, or Lua.

Here is a good place to start with learning Forth. Or here, and for fun, here, too!

Dictionary

A major goal of Guava is keeping the entire language tiny and easily learnable. With this as a goal, the dictionary is kept relatively limited.

The dictionary is broken into 2 categories — words and sigils.

Words are akin to keywords or in-built functions in other languages while sigils are prefixes that guide the interpreter, switching it into different modes (roughly speaking).

Words

#> ( ) * */ + ++ - -- -eq? -if -rot . .s / /* /mod 
2dup ; <# [ ] abs alert and assert assert:false 
assert:true buffer clear confirm cr dec depth drop 
dup el:a el:append el:b el:clear el:h1 el:h2 el:h3 
el:html el:i el:p el:root emit eq? execute false 
gt? gteq? http:get http:post if inc kv:get kv:remove 
kv:set lt? lteq? max min mod negate not obj:parse 
or over pokedex prompt repeat rot sigils space swap 
times true until while words { }

Sigils

! ' / : ?

Introduction

Like most stack-based languages, Guava relies on reverse Polish notation and a LIFO — “last in, first out” — memory stack.

Most programming languages use infix notation, e.g. 3 + 3. If you’ve used Lisp or Scheme you may be familiar with prefix notation, e.g. + 3 3. Reverse Polish notation is the opposite of prefix notation — 3 3 +.

The stack is how data flows through a stack-based language where data is added and removed from the top,” sort of like a stack of dishes. At first blush it seems like stack manipulation is all that a programmer using a stack-based language would be doing all day long, while in reality most folks using stack-based languages tend to keep the stack pretty shallow — Guava also offers an escape hatch, allowing for easy use of variables outside of the context of the stack…which some may say is cheating, but we don’t need that kinda gate keeping.

For more info on how to use Guava take a look at the cookbook.

Editor

A lot of programming languages are pretty similar to one another — once you learn the core constructs of programming (control flow, data handling and storage, etc.) it becomes relatively easy to pick up new languages…the hiccup, I find, comes from needing to learn new tooling. Tooling can be inscrutable, and it is often assumed that you just sort of know it…but it is rarely really taught. For this reason an editor is provided for Guava.

The editor is comprised for 2 parts, an area to display output and an area to collect input. Full disclosure, the area to display output (e.g. console) has a few quirks to it that I’m still trying to work out. If these are a hindrance, you can open up the console of your browser for a more direct view of what is going down.

Screenshot of the Guava editor in action

Code can be input into the lower textarea, clicking the run” button will interpret the code. Any text entered into the textarea is saved to the browser’s local storage with each keystroke.

The clean” button empties the stack and clears the data from the output area.

The destroy” button completely clears all inputted code and resets the environment.

Clicking export” prompts to save input code to disk.

At the far right is a choose file” button — this allows you to load data from disk. NOTE the data is read in from the disk, but any edits aren’t saved back to the disk unless you click the export” button.

An instance of Guava is currently accessible at https://txt.eli.li/pb/guava.

License

Ripen was originally released under the ARTISTIC LICENSE 2.0. With permission from Felix, Guava is licensed under the MIT LICENSE.

For more, check out Guava’s git repository.

In reply to: Built to Last

In a field that has elevated boy geniuses and rockstar coders, obscure hacks and complex black-boxed algorithms, it’s perhaps no wonder that a committee-designed language meant to be easier to learn and use—and which was created by a team that included multiple women in positions of authority—would be held in low esteem. But modern computing has started to become undone, and to undo other parts of our societies, through the field’s high opinion of itself, and through the way that it concentrates power into the hands of programmers who mistake social, political, and economic problems for technical ones, often with disastrous results.

Link logging

I haven’t done a link log in ages. Here is a miniature one for you!

In reply to: Interview with Don Woods

Before brainfuck and Befunge, there was INTERCAL. Its revival in 1990 by ESR may mark the beginning of the esolang movement, but the language dates back to 1972, when it was created in a famous late-night session at Princeton by Don Woods and Jim Lyon. The original version INTERCAL (sometimes called INTERCAL 72) is a rich parody with a more chaotic sense of play than its later revivals. Its instructions are deliberately vague and embrace an almost-believable hacker jargon, collected in a straight-faced, well-organized manual. Don Woods not only co-created INTERCAL, but is also noted for Colossal Cave Adventure, and the original version of the Hacker Dictionary: three essential cultural objects of geek culture.