Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lltz_codegen): change of version + type and other fixes for smartpy compatibility #29

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# LLTZ request for comments
This is a draft implementation of the new shared backend for all Tezos languages.
This is a very early stage draft, no hard decisions have been made, this is a starting point to iterate on so feel free to suggest any changes.

This is a draft implementation of the new shared backend for all Tezos
languages. This is a very early stage draft, no hard decisions have been made,
this is a starting point to iterate on so feel free to suggest any changes.

## Contributing
* Raise issues with any thoughts or suggested changes.
* Feel free to raise draft PR's and comment on other PR's. If there is sufficient agreement convert it out of draft mode.
* The aim is to create an initial implementation with as much concensus as possible, with the understanding that whatever we come up with will evolve during the implementation.

- Raise issues with any thoughts or suggested changes.
- Feel free to raise draft PR's and comment on other PR's. If there is
sufficient agreement convert it out of draft mode.
- The aim is to create an initial implementation with as much concensus as
possible, with the understanding that whatever we come up with will evolve
during the implementation.

## Next Steps
* Decide how we will share the code between languages. (Git submodules opam packages etc.)
* Create passes from Michel and Mini-c to LLTZ IR
* Compile LLTZ IR to Michelson.

- Decide how we will share the code between languages. (Git submodules opam
packages etc.)
- Create passes from Michel and Mini-c to LLTZ IR
- Compile LLTZ IR to Michelson.
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 3.15)
(lang dune 3.7)

(name lltz)

Expand Down
5 changes: 4 additions & 1 deletion lib/lltz_codegen/config.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module I = Michelson.Ast.Instruction
module I = Lltz_michelson.Ast.Instruction

module ExtStack = struct
type t =
Expand All @@ -10,11 +10,13 @@ module ExtStack = struct
match t with
| Ok stack -> Ok (f stack)
| Exceptional -> Exceptional
;;

let merge t1 t2 =
match t1, t2 with
| Ok stack1, Ok stack2 -> Ok (Stack.merge stack1 stack2)
| Exceptional, stack | stack, Exceptional -> stack
;;
end

type t =
Expand All @@ -31,3 +33,4 @@ let merge t1 t2 ~f =
{ stack = ExtStack.merge t1.stack t2.stack
; instructions = f t1.instructions t2.instructions
}
;;
1 change: 1 addition & 0 deletions lib/lltz_codegen/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
(libraries core lltz.michelson lltz.ir fmt)
(inline_tests)
(preprocess (pps ppx_jane))
(flags (:standard -w -26-27))
)
4 changes: 2 additions & 2 deletions lib/lltz_codegen/ident.ml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
open Core

include String

let create =
let next = ref 0 in
fun ?(prefix = "_") () ->
Int.incr next;
prefix ^ Int.to_string !next
prefix ^ Int.to_string !next
;;
Loading