Login

FAQs

Frequently Asked Questions

Note: this page is currently under construction and very much incomplete.

Anselm

Why is it called Anselm?

Anselm is named for St. Anselm of Canterbury, an 11th century philosopher and theologian, and progenitor of the (in)famous Ontological Argument (there are many ontological arguments, but his is generally considered the ur-example). I have deep love of scholastic philosophy and chose the name accordingly. There is joke in here somewhere about a programming language than which no greater can be conceived, but that's not why I chose the name. Actually, I was mostly inspired by Paul Oppenheimer and Edward Zalta's work on deriving a simplified version of the ontological argument with the theorem prover Prover9. Anselm (the language) also draws much inspiration from Pascal (also, the language) and I wanted to continue in the Wirthian tradition of languages named for philosopher-theologians.

Earlier names considered were Carnap and Abelard. Rudolf Carnap has living descendants, so it felt weird to use his name, and I wanted something medieval (as befitting my background) anyway. I liked the sound of Anselm better than Abelard.

Why is it the Yerevan Anselm Compiler?

I lived in Yerevan in the gestational phase of the language!

Why Anselm when {Rust, D, C++, Go, Ada, Zig, Nim, &c.} already exist(s)?

Mostly because none of those languages had the specific feature set, syntax, or style I preferred. I tried to design the language I wanted to use. I've been a long time user of Ada but have grown frustrated with the limitations of that language. Most importantly, none of those languages with the exception of the SPARK subset of Ada support anything like the expressiveness of Anselm's type system.

Is Anselm strict or lazy?

Neither and both! Anselm is based on a formalism called "call-by-push-value" which is arguably "lower level" (Levy refers to CBPV as "semantic machine code") than either strict (call-by-value) or lazy (call-by-need or call-by-name, depending on what is meant by "laziness") evaluation. In essence, in CBPV there is no implicit evaluation at all but as a consequence of making evaluation very explicit, it can express both strict and lazy evaluation (actually, expressing "true" laziness is a bit more complex, but we'll get to that later).

Fine-grained control over evaluation sounds a lot like fexprs, aren't those impossible to compile?

It's not wrong to draw this comparison, but in many ways CBPV is almost the opposite of fexprs. Whereas fexprs have a trivial equational theory, the equational theory of CBPV is very rich.

Why does Anselm have no reserved words?

There are three main reasons:

  • I wanted a grammar robust enough that it did not need to rely on reserved words
  • I wanted to ensure that future additions would not break pre-existing code
  • I wanted to support internalization of the syntax.

The last point is covered later in the FAQ. In general, implementations should provide an option to give errors or warnings when a reserved word is used as an identifier.

Why do negative numbers start with an underscore?

For the same reason that SML uses the tilde, ~: there is a distinction between negation and a negative number literal. Conflating the two would create ambiguity in the grammar.

Of course in practice you can use a minus sign most of the time if you prefer. It works out the same.

Why do expressions not have regular precedence rules?

Precedence rules are hard to memorize; every time I use C I have too look the rules up again. In the presence of custom operators, the situation would be even worse. Anselm's rules are very simple: all operators have equal precedence and associate to the left, except for operators containing the equal sign which do not associate at all and must be bracketed. Anselm is not the first language with this rule, Smalltalk works very similarly. Eliminating precedence makes parsing that much easier.

Why doesn't Anselm support fixity declarations?

Fixity declarations would make the grammar firmly constant sensitive (not at the level of matching, but at building the parse tree). Fixity declarations are also anti-modular, and SML in particular requires non-standard extensions to export them. I don't see any benefit.

Why does Anselm not support type inference?

Inference does not play well with dependent types. Inference for type systems which extend Hindley-Milner tend to be complex and in fact is already incomplete for even SML (largely due to records, among a few other factors). Even in type systems where inference is complete, pathological cases can make it expensive, and more importantly, it can result in confusing, non-local typing errors.

Where are the type classes?

Anselm has a system of implicit arguments, coupled with a powerful, ML-like module system, which can accomplish essentially the same tasks. The limitations of type classes with respect to modularity are well known in the literature but this point, so I won't rehash them here. I've also written a page on why I think typeclasses are not a good abstraction.

Why is there no bundled package manager?

I consider built-in package managers to be a bad case of scope creep. In general, Anselm encourages a different model of development, where code is written, completed, and the distributed the old fashioned way: with tarballs. No need to make this more complex than it needs to be. Really doing package management "correctly" implies the presence of a SAT solver or something equivalently complex. That's a lot of machinery to embed in a compiler. Perhaps when Anselm has its own internal SMT solver for verification of contracts, we'll reconsider this.

What is considered good Anselm style?

We are working on a style guide.

Why do I need to create a unit file just to compile?

Any realistic project is going to need more than just a single file passed to the compiler with no options. See the wiki page on unit files for more information on the rationale.

What is Call-By-Push-Value?

Paul Levy's site contains a short a short FAQ but we also have a wiki page aimed at beginners.

Contributing

What release format does Anselm use?

We have a dedicated page on that.

I'd like to contribute, how can I get started?

Please read the page on our development workflow then send an email to support@anselm.dev (note that this address is currently offline) requesting commit access for your account.

Prolog

Why is Anselm written in Prolog?

The boring answer is that it is because it's what I know. I find with Prolog I can write the interpreter in a style not dissimilar from inference rules in PLT papers. I don't know of any other language which affords this kind of conciseness in this particular domain.

Why not Mercury then?

I frequently use a platform (PowerPC) that Mercury has questionable support for. SWI-Prolog, by comparison, is very portable and easy to use.

Do you plan on self-hosting?

Eventually. However, the Prolog interpreter, anselmpro, will stay as a semi-formal specification.

License

What license is Anselm available under?

Details are available here but the short answer is the the implementation is under the GPLv3, the standard basis library is available under the Boost License, and all documentation (including this site) is published under the GFDLv1.3.

Why the GPL and not a permissive license?

I've worked hard on Anselm and would prefer that it remain free of use to the community. I think it's only fair that if you want to use my work (and please, do!) you contribute back. I created Anselm because I have a humanistic outlook on what software can and should be, and allowing the language to be closed off would violate that. In general, there isn't really a good reason to use a proprietary language anyway.

On top of that, I especially do not want a situation where someone can fork the compiler and make a proprietary, mutually incompatible version. That situation seems pretty unlikely, but on the other hand it did happen with Zig.

Isn't the GPL a "viral" license?

In my opinion, this argument is a complete red herring. It's also literal corporate propaganda. First of all, no one is forcing you to use software made available to you for free. But secondly, the GPL explicitly does not govern the output of GPL'd programs: you are free to write proprietary, closed software with Anselm (although I'd be happier if you didn't). In the case of a language implementation, I think the virality argument makes even less sense than usual.

The standard basis library is made available under the terms of the Boost License, which is similar to the MIT license but does not require the license text to be distributed with compiled object code. The Boost library's website contains a comprehensive rationale for why they adopted the license they did.

I considered but rejected a public domain dedication for the Anselm standard library. In some jurisdictions, such as Germany, it is unclear whether there any exists any mechanism to renounce copyright claims in a way that is legally binding. I also rejected adopting the Unlicense because it seems to contain contradictions in its text.

Fossil

Why do you use Fossil and not Git or even Mercurial?

I find it extremely convenient to have code and documentation stored together. Other options are either not free software or require extensive, ridiculously involved amounts of effort to set up. Use of Fossil just ends these pointless bikeshedding conversations and let's us get on with things. I feel similarly about Fossil's ideological opposition to rebase and its ilk. You should not ever be thinking about VCS, it should be invisible, and I find with Fossil that's the case. I also don't want to have to work to maintain a site separately from the code.

Will you switch to Git/GitHub?

No.

GitHub is the standard! Fossil has no pull requests and that's central to my workflow!

Ok. Don't contribute then. GitHub is not free software and GitLab is very complex and slow.

Self-hosting is non-negotiable for me. Unless an individual has direct control over how their project is hosted, you are always at the mercy of what services a third party feels like continuing to support. This is not a hypothetical fear: I was a loyal BitBucket user until Atlassian decided to remove to Mercurial support. Even if I weren't ideologically opposed to Git, I still think Fossil does what it does better than the competition. GitLab is a gigantic Ruby on Rails project that I'm not entirely convinced I could run on the $3.50/month VPS that this site is currently being hosted on.

Git is so much more powerful than other VCS and is necessary for bigger projects!

I don't see any empirical evidence for that claim.

Site

Why does the site look like pseudo-MacOS 9?

I dunno, I think it's cool.

Your design is historically inaccurate! It mixes BeOS icons with a Charcoal-like font!

That's right. ;)