GithubHelp home page GithubHelp logo

aszecsei / catlang Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 5.8 MB

a programming language

Home Page: https://aszecsei.github.io/catlang/

License: MIT License

Dockerfile 0.08% Rust 68.37% JavaScript 5.34% CSS 0.74% TypeScript 1.92% C 0.34% LLVM 21.18% Assembly 2.03%
compiler

catlang's People

Contributors

aszecsei avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

catlang's Issues

Pratt Parser

Should build a pratt parser for expressions instead of continuing with recursive-descent.

String Pool

We can optimize the memory footprint of the compiler by creating an array of literal strings. Then, each token will simply reference an element in that array (either an existing one or creating a new one as necessary) as its literal value, rather than each token owning its own literal value string. Thus, re-used identifiers (of which there are usually many) will not create duplicate strings in memory.

Error handling

Decide on syntax for error handling. Leaning towards a Rust-like Result<TSuccess, TError> strategy - definitely no exception handling. Panic should be available.

Parse number literals

When looking at a number literal, we want to parse it into a number that Go understands, so that later stages of the compiler can use them. This value should only be stored in tokens for number literals.

Handle floating-point literals

Currently, numbers are assumed to be integers. We should check for the inclusion of a decimal point, and if found, interpret the value as a floating point number instead.

In addition, we should decide whether floating-point literals can start with a decimal point: should ".27" be interpreted as "0.27"?

Add enum representation and assignment

Enums should be able to be backed by any numeric type:

enum Alignment: U32 {
  Left, // 0
  Right = 12, // 12
  Center, // 13
}

Currently, enums are not able to be backed by a value or have their members be assigned a value.

Add support for generics

Generic type parameters should be applicable to structs and functions. Should also finalize syntax for declaring generic type constraints.

Interfaces

Need to decide on syntax for interfaces.

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.