All Projects → mlochbaum → Bqn

mlochbaum / Bqn

Licence: isc
An APL-like programming language. Self-hosted!

Programming Languages

language
365 projects

Projects that are alternatives of or similar to Bqn

Mlton
The MLton repository
Stars: ✭ 683 (+583%)
Mutual labels:  compiler, functional-programming
Mori Ext
Function bind syntax wrappers for mori
Stars: ✭ 15 (-85%)
Mutual labels:  immutable, functional-programming
Ring
Innovative and practical general-purpose multi-paradigm language
Stars: ✭ 716 (+616%)
Mutual labels:  compiler, functional-programming
Koazee
A StreamLike, Immutable, Lazy Loading and smart Golang Library to deal with slices.
Stars: ✭ 446 (+346%)
Mutual labels:  immutable, functional-programming
Idiolisp
A statically typed functional programming language
Stars: ✭ 78 (-22%)
Mutual labels:  compiler, functional-programming
Felix
The Felix Programming Language
Stars: ✭ 609 (+509%)
Mutual labels:  compiler, functional-programming
Cfl
a Compileable statically typed Functional programming Language
Stars: ✭ 7 (-93%)
Mutual labels:  compiler, functional-programming
Fsharp
The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
Stars: ✭ 2,966 (+2866%)
Mutual labels:  compiler, functional-programming
Pfun
Functional, composable, asynchronous, type-safe Python.
Stars: ✭ 75 (-25%)
Mutual labels:  immutable, functional-programming
Jhc Components
JHC Haskell compiler split into reusable components
Stars: ✭ 55 (-45%)
Mutual labels:  compiler, functional-programming
Groovy
Apache Groovy: A powerful multi-faceted programming language for the JVM platform
Stars: ✭ 4,359 (+4259%)
Mutual labels:  compiler, functional-programming
Imlazy
😴 Functional programming with lazy immutable iterables
Stars: ✭ 89 (-11%)
Mutual labels:  immutable, functional-programming
Write You A Haskell
Building a modern functional compiler from first principles. (http://dev.stephendiehl.com/fun/)
Stars: ✭ 3,064 (+2964%)
Mutual labels:  compiler, functional-programming
Clio
Clio is a functional, parallel, distributed programming language.
Stars: ✭ 555 (+455%)
Mutual labels:  compiler, functional-programming
Never
Never: statically typed, embeddable functional programming language.
Stars: ✭ 248 (+148%)
Mutual labels:  compiler, functional-programming
Grin
GRIN is a compiler back-end for lazy and strict functional languages with whole program optimization support.
Stars: ✭ 834 (+734%)
Mutual labels:  compiler, functional-programming
Mlkit
Standard ML Compiler and Toolkit
Stars: ✭ 183 (+83%)
Mutual labels:  compiler, functional-programming
Silt
An in-progress fast, dependently typed, functional programming language implemented in Swift.
Stars: ✭ 217 (+117%)
Mutual labels:  compiler, functional-programming
Immutable Tuple
Immutable finite list objects with constant-time equality testing (===) and no memory leaks.
Stars: ✭ 29 (-71%)
Mutual labels:  immutable, functional-programming
Imtools
Fast and memory-efficient immutable collections and helper data structures
Stars: ✭ 85 (-15%)
Mutual labels:  immutable, functional-programming

View this file with a real REPL here.

BQN: finally, an APL for your flying saucer

documentationspecificationtutorialsimplementation

Try it online below or here, and see running.md for more options.

BQN is a new programming language in the APL lineage, which aims to remove irregular and burdensome aspects of the APL tradition and put the great ideas on a firmer footing. While its use demands a solid understanding of functions and multidimensional arrays, BQN's focus on providing simple, consistent, and powerful array operations (and documentation!) makes it a good language for learning array programming and building stronger array intuition.

BQN maintains many of the ideas that made APL\360 revolutionary in 1966:

  • Human-friendly infix notation has no precedence rules to remember.
  • Built-in array operations handle any number of dimensions easily.
  • Higher-order functions allow basic functions to be applied in more powerful ways.

It incorporates concepts developed over years of APL practice:

But BQN is redesigned from the ground up, with brand new ideas to make these paradigms easier to use and less likely to fail.

What kind of name is "BQN"?

It's three letters, that happen to match the capitals in "Big Questions Notation". You can pronounce it "bacon", but are advised to avoid this unless there's puns.

What does BQN look like?

Rather strange, most likely:

    ⊑+`∘⌽⍟12↕2  # The 12th Fibonacci number

More snippets are programmed into the live demo at the top of the page: hit the arrow at the right of the code window to see them. For longer samples, you can gaze into the abyss that is the self-hosted compiler, or the shallower but wider abyss of the runtime, or take a look at the friendlier markdown processor used to format and highlight documentation files. This repository also has some translations from "A History of APL in 50 Functions".

How do I work with the character set?

Right at the beginning, you can use the bar above the online REPL to enter BQN code: hover over a character to see a short description, and click to insert it into the editor. But you'll soon want to skip the clicking and use keyboard input. I type the special characters using a backslash escape, so that, for example, typing \ then z writes (the backslash character itself is not used by BQN). The online REPL supports this method out of the box, and configuration files to enable it in various other places are included with the editor plugins. There's also a bookmarklet you can use to enable BQN input in any webpage in your browser.

The font comparison page shows several fonts that support BQN (including the one used on this site, a modified version of DejaVu Sans Mono). Most other monospace fonts are missing some BQN characters, such as double-struck letters 𝕨, 𝕩 and so on, which will cause these characters to be rendered with a fallback font and possibly have the wrong width or look inconsistent.

How do I get started?

Writing good learning material for a programming language is a pretty huge task, so neither the tutorials nor the documentation are complete. With some willingness to experiment and possibly outside knowledge of array programming, it's enough to get by, just not smooth sailing.

BQN's tutorials are intended as an introduction to array programming with BQN. They assume only knowledge of elementary mathematics, but will probably be hard to follow if you have no programming experience. BQN has a lot in common with dynamically-typed functional languages like Lisp, Julia, or Javascript, so knowledge of these languages will be particularly helpful. However, there's a significant (but shrinking) gap between the last tutorial and existing documentation. If you're motivated, you may be able to get across by reading material on other array languages like APL, J, NumPy, or Julia.

If you're already an array programmer, then you're in better shape: the current documentation covers nearly all differences from APL, and the BQN-Dyalog APL or BQN-J dictionary might also be a useful resource. However, you should be aware of two key differences between BQN and existing array languages beyond just the changes of primitives—if these differences don't seem important to you then you don't understand them! BQN's based array model is different from both a flat array model like J and a nested one like APL2, Dyalog, or GNU APL in that it has true non-array values (plain numbers and characters) that are different from depth-0 scalars. BQN also uses syntactic roles rather than dynamic type to determine how values interact, that is, what's an argument or operand and so on. This system, along with lexical closures, means BQN fully supports Lisp-style functional programming.

A useful tool for both beginners and experienced users is BQNcrate, a searchable collection of BQN snippets to solve particular tasks. If you have a question about how you might approach a problem, give it a try by typing in a relevant keyword or two.

Where can I find BQN users?

There's a BQN channel on Matrix (#bqn:matrix.org), which can be opened in the Element client with this link, and one on Discord that you can join with this invite. The two channels are bridged so that comments in one appear in both. It should also be possible to link in an IRC channel, so contact me or get on one of the existing forums if you'd like to discuss making one. Past BQN discussion has mostly taken place on the APL Orchard forum, but I can no longer recommend it for discussing BQN.

Asking programming questions in chat won't make it easy for future BQN users to find them. Especially if you have a general question about how the language or its environment works, consider asking at topanswers.xyz/apl with the "bqn" tag.

In addition to these forums, you can contact me personally via Github issues or with the email address shown in my Github profile.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].