Giter Club home page Giter Club logo

ipulang's Introduction

ipulang

  • まずはレジスタ型でなくスタック型
  • まずは型はintだけ

やることリスト

Day1

  • nomの理解
  • CLIにする
    • cargo run -- <input> --output <output>
  • nomでASTにする
  • LLVM IRを理解する
    • inkwell を使う
  • 変数機能
    • parser
    • node
    • codegen
    • 変数初期化
    • assign
  • 関数宣言
    • parser
    • node
    • codegen
    • main関数宣言
    • main以外の関数宣言
    • return文
    • 関数呼び出し
      • 引数付きで呼び出す
        • 引数のallocaをまだやっていない
  • declare
    • putchar
    • getchar

Day2

  • 構文追加
    • if
    • for
  • 型を導入する
    • i32, i64, bool
      • astに型の情報を入れる

Day3?

  • 文字列型の導入
  • ポインタ型の導入
  • 配列型の導入
  • include
  • (error tracing)
  • parser書き直す?
    • row, columnの情報が欲しい
  • REPL
  • 入力
  • コメント
  • 構造体

やらないこと

  • LSP
    • hard
    • syntax highlight
  • formatter -> ASTを文字列化してそう
  • web assembly

マイルストーン

  • 定数, 四則演算が出来る
    • cmmを理解する
    • pl0を理解する
    • 定数をパースできる
    • 四則演算をパースできる
    • 変数を宣言, 使用できる
    • main関数を宣言できる
  • LLVM IRコード生成
  • fizzbuzz

LLVM fix

apt install libclang-common-12-dev llvm-12

ipulang's People

Contributors

hamadakafu avatar wakame-tech avatar

Forkers

wakame-tech

ipulang's Issues

Support String

overview

  • able to use a string literal "hoge"
  • create string type
  • support print(value: string): unit function
  • LLVM IR codegen

Support `#include`

overview

  • support #include<path/to/code.ipu> syntax
  • extend file content before compiling

Rewriting the parser with using `chumsky` crate

Overview

Currently, ipulang program directly parses to AST by using the parser combinator, nom crate. it is not suitable for supporting comment statements and getting token location for supporting syntax highlighting in its LSP. Therefore, want to rewrite the parser to support token location acquisition.
Specifically, we use zesterer/chumsky crate.
I thought about parsing custom input sequences by nom. but I decided not to use . I'm going to chose chumsky because it can output rich error reports with ease by using zesterer/ariadne crate.

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.