Perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away.
(Antoine de Saint-Exupéry, translated by Lewis Galantière.)
dotLang is a general-purpose programming language which is built upon a small set of rules and minimum number of exceptions and a consistent set of specifications.
Because it is:
dotLang is very similar to C but with some significant improvements:
That’s why I am creating a new programming language: dotLang.
dot programming language (or dotLang for short) is an imperative, static-typed, garbage collected, functional, general-purpose language based on author’s experience and doing research on many programming languages (namely Go, Java, C#, C, C++, Scala, Rust, Objective-C, Swift, Python, Perl, Smalltalk, Ruby, Haskell, Clojure, Eiffel, Erlang, Elixir, Elm, Falcon, Julia, Zig, F# and Oberon-2). I call the paradigm of this language “Data-oriented”. This is an imperative language which is also very similar to Functional approach and it is designed to work with data. There are no objects or classes. Only data structures and functions. We have first-class and higher-order functions borrowed from the functional approach.
Two main objectives are pursued in the design and implementation of this programming language:
Achieving both of the above goals at the same time is impossible, so there will definitely be trade-offs and exceptions. The underlying rules of design of this language are Principle of least astonishment, KISS rule and DRY rule.
As a 10,000 foot view of the language, the code is written in files (called modules) organized in directories (called packages). We have bindings (immutable data which can be functions or values) and types (Blueprints to create bindings). Type system includes primitive data types, sequence, map, enum, struct and union. Concurrency and lambda expression are also provided.
|Language||First-class functions||Sum types||Full Immutability||Garbage Collector||Module System||Concurrency*||Generics||built-in data types||Number of keywords|
dotLang consists of these components:
dot: A command line tool to compile, debug and package source code.
corelibrary: This package is used to implement some built-in, low-level features which can not be simply implemented using pure dotLang. This will be a built-in feature of the compiler/runtime.
stdlibrary: A layer above core which contains some general-purpose and common functions and data structures. This is optional to use by developers.
Grammar of dotLang in a notation similar to EBNF can be found here
Currently, the language manual is finalised. Please contact me if you are interested in helping either with the documentation or implementation.