πŸ“š Agora node [[lang]] β˜†
Agora nodes contain community contributions with titles or topics that match your search. x
πŸ“œ File pages/LANG.md by @sparql β˜† πŸ“Ž β›Ά

type:: [[Function/On RDF Terms]]

Loading pushes...

✨ AI Synthesis Mistral Gemini ChatGPT Claude x

Expanding this section will automatically generate an AI synthesis of the contributions in this node.

🌌 Agora context for [[lang]]

Rendering context...

πŸ“š Agora node [[20210311213613 erlang]] (pulled by the Agora)
πŸ“œ File 20210311213613-erlang.org by @ryan β˜† πŸ“Ž
πŸ“š Agora node [[beetlang]] (pulled by the Agora)
πŸ“œ File beetlang.myco by @melanocarpa β˜† πŸ“Ž οΈπŸ”— ✍️

Every year I write a parser. I'm kinda getting tired of that.

Beetlang is the concept of a programming language for the uxn ecosystem I want to develop. It is going to simplify common uxntal idioms, while still providing access to raw bytes. I want it to be a superset of TAL.

As we know, uxn is a beetroot, so the name of the language is Beetlang.

I am far from deciding the final set of features. This is a draft.

You can feel the influence of Mycomarkup.

Additions

Functions

In uxn, you do functions all the time:

@add-two ( x -- x+1 )
   #02 ADD
JMP2r

There is the pattern:

  1. The label.

  2. A comment describing expected stack and the output stack.

  3. Indented body.

  4. The jumping back opcode.

The comment means nothing. You can lie there. The jumping back can be messed up.

Equivalent Beet code would look like this:

func add-two x -- x+1 {
   #02 ADD
}

Not much of an abstraction, but imagine what things a Beet compiler could do. It could try to prove the correctness of the signature!

Dance

An attempt to make code self-documenting by nature.

There are three directives:. All text after a directive is a comment. Maybe I should put it before?

  • = the let directive.

  • : the rearrange directive generates needed ROT, DUP, etc opcodes to get the given result. There can be many. I suppose there are limits to that.

  • + the execute directive.

dance {
   x y z     = Three bytes are on stack
   y z x     : Get x to the top
   y z x x   :
   #01 ADD   +
   y z x x+1 =
   x+1 x y z :
}

Some assertions can also be made.

Loops

times <operation> {
   <code>
}

It takes the number from top of the stack and executes the loop that number of times, and then POPs it.

You specify the operation done with the number on stack (it decreases). You will usually just SWP it.

Strongly typed Varvara devices

And their names will be fixed. There is a convention already anyway.

Less cryptic graphics operations

paint sprite {
   addr ;stone
   put
   right 1
   reverse
   color 3
   put
}

Something with the Screen/auto port can be done too.

Constant expressions

const {
   #03 #02 ADD
}

will compile to just #05. Defined macros and Beetlang are available in constant expressions.

CLI commands

  • cat game.beet | beet > game.tal compiles beet to tal

  • cat game.beet | beet --locate-addr sprites/stone finds the location of the given label

  • cat game.beet | beet --run compiles twice and runs the ROM with some emulator it finds, and deletes intermediate files, if any.

As you can see, input is fed through stdin.

To think about:

πŸ“š Agora node [[crablang]] (pulled by the Agora)
πŸ“œ File CrabLang.md by @agora@botsin.space β˜† πŸ“Ž
πŸ“š Agora node [[elixir vs erlang]] (pulled by the Agora)
πŸ“œ File wiki/Computer-Science/Languages/Elixir vs Erlang.md by @jaysen β˜† πŸ“Ž οΈπŸ”—

Elixir and Erlang run on the exact same virtual machine (BEAM) and share identical concurrency, fault-tolerance, and performance characteristics, differing primarily in syntax, developer tooling, metaprogramming, and ecosystem focus.

Erlang pioneered telecom-grade distributed systems in 1986

Elixir was created in 2012 to provide a modern developer experience and cleaner syntax on top of Erlang’s rock-solid runtime.

Key Differences at a GlanceΒ§

Feature Erlang Elixir
Release Year 1986 (Ericsson) 2012 (JosΓ© Valim)
Syntax Style Prolog-inspired (punctuation-heavy: ., ,, ;, uppercase variables) Ruby-inspired (clean do...end blocks, lowercase variables, |> pipe operator)
Metaprogramming Limited (parse transforms are complex and discouraged) First-class, hygienic macros using Abstract Syntax Trees (AST)
Tooling Historically fragmented (now centered on rebar3) Unified out-of-the-box (mix, iex, ExUnit, built-in formatter)
Strings & Unicode Lists of integers by default ("hi" = [104, 105]); binaries require <<"hi">> UTF-8 binaries by default ("hi"), with full built-in Unicode support
Polymorphism Behaviours and manual pattern matching Protocols (extensible polymorphism for any data type) + Behaviours
Type System Dynamic + Dialyzer (success typing) Dynamic + Built-in gradual set-theoretic typing + Dialyzer
Primary Ecosystem Telecoms, distributed databases (RabbitMQ, CouchDB, Riak), messaging Modern web apps (Phoenix / LiveView), IoT (Nerves), ML/data (Nx / Livebook)

Core Technical & Ergonomic DistinctionsΒ§

  • Syntax and Readability: Erlang ends every expression with a period (.), separates clauses with semicolons (;), and capitalizes variable names (UserId). Elixir uses familiar modern syntax, lowercase variables (user_id), and the pipe operator (|>), which chains data transformations cleanly from top to bottom instead of nesting function calls.
  • Metaprogramming & Extensibility: Elixir allows developers to inspect and generate code at compile time via macros. Much of Elixir itself is written in Elixir macros, enabling expressive domain-specific languages (DSLs) like Phoenix routes and Ecto database queries.
  • String Handling: Erlang predates UTF-8, so double-quoted strings are linked lists of character codesβ€”which uses significant memory and complicates Unicode. Elixir treats double-quoted strings as UTF-8 encoded binaries natively.
  • Variable Rebinding: Both languages have immutable data, meaning values in memory never change. However, Elixir allows you to rebind a variable name to a new value (x = 1, then x = 2), whereas Erlang strictly forbids reassigning a bound variable (X = 1, X = 2 throws a badmatch error).
  • Zero-Cost Interoperability: You can call any Erlang module directly from Elixir with zero performance overhead (e.g., :crypto.strong_rand_bytes(16) or :ets.new(...)), and vice versa. Learning one gives you access to the libraries of both.
πŸ“š Agora node [[erlang]] (pulled by the Agora)
πŸ“œ File pages/erlang.org by @jakeisnt β˜† πŸ“Ž

Programming Languages

References

Erlang 23 Release Notes heres another one on erlang The Beam Book a resource for learning Erlang

πŸ“œ File wiki/Computer-Science/Languages/Erlang.md by @jaysen β˜† πŸ“Ž οΈπŸ”—

setup on FedoraΒ§

  1. Install with sudo dnf install erlang rebar3. Fedora’s packages are fairly current. If you want a specific newer version later, use mise or asdf instead.
  2. Check that it works: run erl to open the Erlang shell, and quit with q().
  3. Create a project with rebar3 new app follower. That gives you an OTP application skeleton with a supervisor already in place.
  4. Run it with rebar3 shell inside the project folder. It compiles everything and drops you into a shell with your app loaded.
  5. Editor: in VS Code, install the Erlang LS extension for completion, go-to-definition and inline errors.
πŸ“œ File Erlang.md by @agora@botsin.space β˜† πŸ“Ž
πŸ“š Agora node [[fritz lang]] (pulled by the Agora)
πŸ“œ File fritz lang.md by @agora@botsin.space β˜† πŸ“Ž
πŸ“œ File fritz lang.md by @an_agora@twitter.com β˜† πŸ“Ž
πŸ“š Agora node [[golang]] (pulled by the Agora)
πŸ“œ File golang.md by @vera β˜† πŸ“Ž

Programming language from google that I use extensively

πŸ“œ File golang.md by @agora@botsin.space β˜† πŸ“Ž
πŸ“œ File Golang.md by @agora@botsin.space β˜† πŸ“Ž
πŸ“œ File golang.md by @flancian@social.coop β˜† πŸ“Ž
πŸ“š Agora node [[rustlang]] (pulled by the Agora)
πŸ“œ File RustLang.md by @agora@botsin.space β˜† πŸ“Ž
πŸ“œ File rustlang.md by @an_agora@twitter.com β˜† πŸ“Ž
πŸ“š Agora node [[slang]] (pulled by the Agora)
πŸ“œ File slang.md by @agora@botsin.space β˜† πŸ“Ž
πŸ“š Agora node [[tweets from nat lang]] (pulled by the Agora)
πŸ“œ File Readwise/Tweets/Tweets From Nat Lang.md by @protopian β˜† πŸ“Ž

Tweets From Nat LangΒ§

rw-book-cover

MetadataΒ§

HighlightsΒ§

πŸ“š Agora node [[vlang]] (pulled by the Agora)
πŸ“œ File vlang.md by @patterning β˜† πŸ“Ž
πŸ“œ File vlang.md by @vera β˜† πŸ“Ž
πŸ“œ File stoa-test-2/vlang.md by @agora β˜† πŸ“Ž
πŸ“œ File stoa-test/vlang.md by @agora β˜† πŸ“Ž
πŸ“œ File vlang.md by @anonymous@doc.anagora.org β˜† πŸ“Ž ✍️