Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jt2m0l3y/mypl
Programming language designed for the purpose of studying compilation and runtime processes. As a side note, OCaml was also introduced to contrast with imperative languages.
https://github.com/jt2m0l3y/mypl
ast code-generation compiler-design cpp grammars jit lambda-calculus lexical-analysis ocaml parsing type-checking vm
Last synced: about 15 hours ago
JSON representation
Programming language designed for the purpose of studying compilation and runtime processes. As a side note, OCaml was also introduced to contrast with imperative languages.
- Host: GitHub
- URL: https://github.com/jt2m0l3y/mypl
- Owner: JT2M0L3Y
- Created: 2023-05-30T08:21:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-16T18:44:15.000Z (9 months ago)
- Last Synced: 2024-02-16T19:46:14.452Z (9 months ago)
- Topics: ast, code-generation, compiler-design, cpp, grammars, jit, lambda-calculus, lexical-analysis, ocaml, parsing, type-checking, vm
- Language: C++
- Homepage:
- Size: 27.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# README
## MyPL - Programming Language Interpreter
### Description
This programming language is a work in progress. I finished a basic set of operations, constructs, and methods that can be performed as per the requirements of a PL course. Beyond this, I have started extending this language by adding an additional construct: dictionaries (Python) or undordered maps (C++).
### Table of Contents
- [Install](#install)
- [Usage](#usage)
- [Credits](#cred)To "install" this language one must run a set of commands:
- CMake to build tools that will process dependencies
```
cmake .
```
- Make to process dependencies and build the language
```
make
```To run:
```
./mypl [flag] [file]
```Available flags:
`--lex`: lexical analysis
`--parse`: parsing, AST generation
`--print`: pretty printer
`--check`: semantic checking
`--ir`: machine instruction generation
`--help`: usage messageFeatures:
- lexical analysis
- simple parsing
- AST generation
- pretty printer
- semantic checking
- machine instruction generation with VM
- running programs written in 'MyPL'Language Benefits:
- types
- user-defined ```struct [name] { [fields]* }```
- 1D arrays ```array [type] [id] = new [type][ [size] ]```
- primitive ```[type] [id] = [val]```
- methods
- length (string, arrays) ```length([id])```
- get/set fields ```[id][val]```
- get/set array index ```[id][val]```
- get char in string ```get(val)```
- terminal I/O (print, input) ```print([type]), input()```
- extended use
- dictionary (unordered map) type ```dict [type1] [type2] [id] = new dict{type1, type2}```
- methods: keys, values ```keys([id]), values([id])```An example of this language's use has been published to
[YouTube](https://www.youtube.com/watch?v=ngUi5oREe8E).Contributors:
- JT2M0L3Y
- Dr. Bowers