Giter Club home page Giter Club logo

alechi's Introduction

Alechi

Alechi will be a language that compiles to C. Its goal is to provide roughly all of C's features and some more, with a better type system and some syntactic sugar.

Some ideas

  • A module system similar to ML's, with separate interface and implementation files (yes it will have headers). Bindings private to a module should probably still be callable, but they should output a warning.

  • ML functors? (so that a program could e.g. define its custom allocator for the functions in the standard library).

  • No dependency on the C standard library or any other C library. Output pure C with no GCC extensions.

  • External C functions would not be directly callable, but would have to be declared in a module without implementation.

  • Syntax should be a mix of C, ML, ReasonML, Jai. Curly braces, semicolons and snake_case everywhere. Modules and ADTs PascalCased.

  • Extend the ML type system with type classes, either similar to OCaml (modular implicits) or Ur/Web (normal values). The language would make heavy use of these for e.g. testing equality, arithmetic, iterating, casts...

  • Use modular implicits for allocating and deallocating structures and memory with polymorphic alloc and free functions. C++ has something similar with allocators, Zig passes allocators to functions that need them.

  • Optionally emit clang module maps for faster compilation.

  • Keyword for explicit tail calls (become, jump...). (how would this even work in C)

  • Different types of strings prefixed by a letter (e.g. b"foo"), maybe even user-definable.

Links

Some stuff to read and research.

Clang modules

A theory of type qualifiers

Type Qualifiers as Composable Language Extensions

Compiling SML to C

Resource Polymorphism: adding destructors and move semantics to OCaml

Practical Affine Types

All the languages together

Stuff

The name is the italian spelling of the japanese nickname (Aleki) of Alexandrite from Houseki no Kuni (Land of the Lustrous). I have no excuse to name the language like this other than I like the character. And it's pretty googleable.

alechi's People

Contributors

steinuil avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.