Skip to content

Introduction in English

Ignacio Perez edited this page Dec 5, 2023 · 4 revisions

Introduction

Note

This may change, as the language is in development and evolving; it is only in its early stages as a language and is just another toy language.

Ignis is a general-purpose programming language, with static and strong typing, and immutability by default in variables. Languages that inspired Ignis are TypeScript and Rust. It features a Garbage Collector for class memory management and rules of ownership and borrowing, similar to Rust. The goal of Ignis is not to be used by everyone, but a language for me to learn how to create and understand how a programming language works. And if I could incidentally use it to create scripts to replace code written in Bash or other languages, especially Lua and Python (I hate Lua), that would be ideal.

Language Objectives

The main goal is to be a language similar to TypeScript, without the negative aspects of TypeScript, able to transpile to JavaScript, and to avoid all the problems that entails. And with features from Rust, like variable immutability, static typing, and ownership and borrowing of variables and functions.

It will also have a small Garbage Collector for managing the memory of classes and data structures, but with variable ownership rules like Rust. The idea of doing this as a midpoint between the two concepts is to not have the penalty of a huge GC and not have the lifetime problems that exist in Rust with structures, that is, to operate the best of both worlds.

Also, it will transpile to Lua (I hate Lua), so I never have to use Lua directly again. There are alternatives for Lua that transpile to Lua with static typing, but none of them appeal to me.

import { println } from "std:io";

function main(): void {
  println("Hello World");
}

The language was mainly going to be compiled to binary by default but with the option of being interpreted to replace scripts in Bash or Python. But the first is not yet available due to being very complex and certain problems with LLVM. This remains an option, but now for practicality, it will go for a ByteCode and a virtual machine.

Objectives

Have TypeScript-style Syntax

It already does; it is one of the first things that were implemented. There are features missing, like classes, enums, template literals, arrow functions, etc. Little by little.

Compiled

As I said, it is not compiled at the moment due to technical limitations.

Static and Strict Typing

This is one of the best features of the language. Never again have to endure an object returning undefined because its property does not exist or a number and a string being added because you do not know what is coming as a function parameter.

Possibility of Transpiling to Lua

The idea here is for the language to be able to transpile to Lua with the aim of configuring NeoVim. The goal would be to have an Ignis library with the signature of the NeoVim API and ease to add the APIs of the chosen plugins.

Compatibility with Scripting

I do not want it to be the main function, but maybe with the ByteCode, this restriction can be skipped. My goal with this is to replace scripts that I have in my system with code in Ignis.

Standard Library

Obviously, a language worth its salt has to have a good standard library. Things I want this library to have:

A Good HTTP Library

A backend developer cannot have a bad HTTP library. My goal is to be able to create a 100% functional backend with the standard library.

Test Library

Like the library that comes included with Rust.

CLI Library

To make my life easier when creating scripts and commands. Like Rust's clap but integrated into the standard library.

IO

There is no serious language that does not have standard input and output.

Memory Management

Mainly to be able to reimplement the GC in Ignis without problems.

Env

To accompany the HTTP library.

Regex

A Regex library.

Math

Functions and constants to perform mathematics in Ignis.

Time

I would like to make a significant and correct emphasis on this, so as not to have a JavaScript Date and not have to depend on an external library.

Primitives

The main idea of the primitives is not the primitives themselves, but the methods associated with them, such as a .toString() in all data types, or a converter from string to int, for example. Necessary things to be able to work in a programming language with static and strict typing.

"Package" Manager

It is not something that absolutely has to be, but it would be good if libraries or programs are created in Ignis and they can be downloaded and installed or added to a project. More or less like Cargo would be in Rust or NPM for Node. I do not have high aspirations, I do not think I will have a central repository where things are downloaded, just downloading from GitHub or a git repository is fine.