virgil

Learning Virgil coming from another programming language

A lot of programmers who come to Virgil already have familiarity with another language. That’s great, Virgil is specifically designed so that expertise in other (particularly curly-braced) languages transfers over. It avoids making too many controversial syntactic choices that just cause friction.

If you are coming from some of the languages below, you may find some things pleasant and familiar, while finding other things new or weird. Never fear! Virgil wants to challenge you without making you mad. It’s not here to insult your favorite language or start a fight.

Coming From Java/C#

Virgil was heavily influenced by both of these languages. In fact, the JVM was the first execution platform where Virgil was fully self-hosting (the compiler could compile itself and run on that platform). These main ideas from these languages are carried forward:

However, unlike both of these languages, Virgil does not have:

But Virgil has these features that neither of these languages have:

Coming from JavaScript

Both Virgil and JavaScript were influenced by Java, so a lot of the curly-brace syntax looks familiar. JavaScript is a dynamically-typed language, where variables, fields, and arguments are not given explicit types. Virgil, however, is statically typed. In many situations, Virgil will infer the types of fields and variables (that have initialization expressions).

There are many features of JavaScript that Virgil lacks.

Of these, Virgil is planning on adding lambdas in the future. Also, many years of tuple wrangling has suggested the need for destructuring assignments.

Virgil does have some things that JavaScript programmers might like:

Coming from C

Coming from C++