Code Monkey home page Code Monkey logo

deeplang-type-system's Introduction

Deeplang Type System

We are learning TAPL and developing some interesting projects as follow:

Todo list:

  • Deeplang parser/lexer
  • Deeeplang typing rules
  • Deeplang symbol table
  • Deeplang type checker and then type infer
  • Deeplang wasm codegen

Prepare

  • ocaml >= 4.12.0
  • dune >= 2.8

Building

Currently, only the AST definition is completed. Its source file is at parser/ParseTree.ml. To build the AST definition, you need an OCaml compiler and the dune build system. To build directly with dune, do:

dune build

You can also build with Makefile, via:

make build

To build the module document of source files as well, you need to install the odoc document generator as well. Once odoc is installed, you can build module documents through:

make doc

The generated documents of internal modules are located in doc/internal/module_name-xxxxxxxxxx, in HTML format. You can preview the HTML online by opening the link of the HTML file in

To build source files and document together, do:

make all # or simply `make`

Development Guide

To add new OCaml modules, you just need to modify the dune build file, and add your modules/libraries/executables into it. You can find the document of dune here.

deeplang-type-system's People

Contributors

chiakicage avatar chinesebear avatar guest0x0 avatar hobbitqia avatar ldzzz2 avatar mepy avatar mmzk1526 avatar rightbreeze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

hobbitqia

deeplang-type-system's Issues

deeplang.cf compile error in raspberry pi 3B

My bnfc versio is 2.8.1

> ocaml --version
The OCaml toplevel, version 4.05.0

Cannot generate Testdeeplang binary.

Use Bytes.set instead.
File "Testdeeplang.ml", line 6, characters 4-21:
Error: This function has type
         (Lexing.lexbuf -> Pardeeplang.token) ->
         Lexing.lexbuf -> Absdeeplang.code
       It is applied to too many arguments; maybe you forgot a `;'.
make: *** [Makefile:4\uff1aall] \u9519\u8bef 2
make: \u79bb\u5f00\u76ee\u5f55\u201c/home/pi/github/deeplang-type-system/output\u201d

2021-09-04-182404_1920x1080_scrot

ADT成员参数列表参数名字支持的问题

a2335ff21cd7643507a7fb6c1dd5b53
这个名字有助于解释参数意义,应该要加上吧。

主要,因为ADT有分支,所以不能像结构体一样用名字取出值
有一种方案是,允许ADT的分支定义一个私有结构体,这是OCaml的一个功能

image

new AST discussion

This issue is a tracker for the new AST in new-AST-dev branch.
Definition of the AST is located in parser/ParseTree.ml,
Module documentation generated by OCaml is located in doc/internal/deeplang@.../DeeplangType/.
To view the generated HTML doc, you can paste the URL athttp://htmlpreview.github.io,
or clone the repo to your local machine and view it with your browser.

Currently the AST definition is not yet complete.
There are several topics that require further discussion.
You can find them in the generated HTML doc, labeled DISCUSSION WANTED.

If you have any idea on any of the topics listed, or have some other questions on the AST's definition,
you can post them in this issue for discussion.

Parser无法处理只declare不初始化

fun main(x: Char) {

  let x : I32 = 1;
  let a: I32 = 2;
  let b: F32 = 3.0;
}

可以parse,但是

fun main(x: Char) {

  let x : I32;
  let a: I32 = 2;
  let b: F32 = 3.0;
}

会parse报错:

syntax error: Expecting pattern
in [file "../examples/basicMain.dp", row 3, col 13 to row 3, col 14]

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.