cyrus- / relit Goto Github PK
View Code? Open in Web Editor NEWHygienic typed literal macros (TLMs) for Reason
License: MIT License
Hygienic typed literal macros (TLMs) for Reason
License: MIT License
That's the most recent release of the compiler. How hard would this be? Can we use the OCaml preprocessor to simultaneously support different versions of Typedtree in the same repository? Might depend on #7.
Is this being worked on? Has anyone documented why it doesn't work yet? Using relit
with my ocaml / dune project would be a huge boon for my team.
We use Failure to match against splice โ instead move to a custom defined exception
There are two issues in the code that is generated right now for a TLM application, e.g.:
let regex =
/* open Pervasives to ensure context independence */
Pervasives.(
/* open $regex's Dependencies, again insuring context indepedence
(RelitInternalDefn_regex is Relit's internal way of saying $regex) */
Regex_notation.RelitInternalDefn_regex.Dependencies
.(
() => (
Regex.Or(
Regex.Str("a"),
Regex.Star(Regex.Str("b")),
/* a type assertion that the expansion is the type the notation definition specified */
): Regex_notation.RelitInternalDefn_regex.t
)
)
)();
First, the module Regex_notation in the path to the dependencies will be resolved relative to Pervasives, which is incorrect. Second, the expansion type annotation will be resolved relative to the Dependencies, which is also incorrect. Very unlikely to encounter either bug, but we should fix this. I think the correct code that should be generated is:
let regex = {
module RelitInternalDependencies = Regex_notation.RelitInternalDefn_regex.Dependencies;
Pervasives.(
RelitInternalDependencies
.(
() => (
Regex.Or(
Regex.Str("a"),
Regex.Star(Regex.Str("b"))
)
)
)
)() : Regex_notation.RelitInternalDefn_regex.t;
};
This should make it so you don't need the trailing comma in the list example.
Add note to readme showing how to output asts.
One for each sort of output.
Ideally, we would be able to do opam install relit
or maybe opam install reason-relit relit
instead of having to checkout the two repos and make. We were working on this -- what's the status?
It's functionality is tested: all that's needed left is to add tests specifically for let notation
Something changed with how ASTs are represented there, so our code doesn't work anymore if we upgrade to ppxlib.0.3.1+
i.e. "omelit". Making an issue to track that effort.
Hello!
There's recently been several threads around the Reason syntax repo and related ppx
's for supporting the equivalent (or something fulfilling a subset of the requirements) of Haskell's do-notation
.
It'd be a very interesting point in this conversation to be able to have/showcase a sample/standard do-notation available to use with relit
.
Mark this as a #feature-request, but I'd be interested in looking into it.
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.