pmatos / nora Goto Github PK
View Code? Open in Web Editor NEWAn experimental Racket implementation using LLVM/MLIR
License: Apache License 2.0
An experimental Racket implementation using LLVM/MLIR
License: Apache License 2.0
Should save the SARIF file and add it to the security tab.
Also add a PR workflow that warns the user in the PR if the patch has a problem.
We are using plog for logging but possibly better is to use llvm::dbgs facility.
Setup codecov for the project.
We have defined ToTopLevelNode and ToExprNode structs with operator()
to upcast variants. I am sure there's a way to simplify this in C++.
This should be a NFC enhancement.
LLVM provides dyn_cast for downcasts. We should use those goodies from the LLVM lib.
Search for static_cast, and there are mostly the places where dyn_cast can be used.
We already do this manually in interpreter.cpp at least once and more situations like these will happen.
The current nodes that should be part of runtime should be removed and added to the environment during a prepareRuntime method executed at Interpreter construction time.
We need a Writer class that writes Racket values, as opposed to the dumper who is supposed to dump ASTNodes.
An example where these differs is values.
The Writer should write (values 1 2) as
1
2
while the Dumper should dump it as
(values 1 2)
The following test crashes nora:
;; RUN: norac %s | FileCheck %s
;; CHECK: 12
(linklet () ()
(define-values (fn) (values 0))
(let-values (((x) (values 2)))
(set! fn (lambda (y) (+ x y))))
(let-values (((x) (values 3)))
(fn 10)))
There's a warning from ubsan as well:
Cannot set undefined identifier.
Expected lambda expression in Application.
/home/pmatos/dev/nora/src/include/interpreter.h:43:52: runtime error: member call on null pointer of type 'ast::ValueNode'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /home/pmatos/dev/nora/src/include/interpreter.h:43:52 in
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==23846==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x56310e36d3d7 bp 0x7ffebfb63690 sp 0x7ffebfb63650 T23846)
==23846==The signal is caused by a READ memory access.
==23846==Hint: address points to the zero page.
#0 0x56310e36d3d7 in Interpreter::getResult() const /home/pmatos/dev/nora/src/include/interpreter.h:43:52
#1 0x56310e36cae7 in main /home/pmatos/dev/nora/src/main.cpp:53:26
#2 0x7f2ef4c3c78f (/usr/lib/libc.so.6+0x2378f) (BuildId: 4a4bec3d95a1804443e852958fe59ed461135ce9)
#3 0x7f2ef4c3c849 in __libc_start_main (/usr/lib/libc.so.6+0x23849) (BuildId: 4a4bec3d95a1804443e852958fe59ed461135ce9)
#4 0x56310e33aa74 in _start (/home/pmatos/dev/nora/build/bin/norac+0x164a74) (BuildId: ff1360b6f90819159bf3d99f7e8a9ddb2f700ae2)
UndefinedBehaviorSanitizer can not provide additional info.
SUMMARY: UndefinedBehaviorSanitizer: SEGV /home/pmatos/dev/nora/src/include/interpreter.h:43:52 in Interpreter::getResult() const
==23846==ABORTING
I also think that even once this is fixed nora will print 13, rather than 12.
GCC can't compile nora atm. However, since we track MLIR very close to HEAD of LLVM it might be that this is not realistic. Support for C++20 might be different etc. So I am putting this here but won't look into it in the near future.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.