Skip to content

Commit

Permalink
feat(lltz_codegen): formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmarkoTrilitech committed Oct 7, 2024
1 parent 07c8358 commit 43ef79c
Show file tree
Hide file tree
Showing 16 changed files with 3,674 additions and 2,853 deletions.
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.
3 changes: 3 additions & 0 deletions lib/lltz_codegen/config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
;;
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

0 comments on commit 43ef79c

Please sign in to comment.