All Projects → hazelgrove → Hazel

hazelgrove / Hazel

Licence: mit
Hazel, a live functional programming environment with typed holes

Programming Languages

ocaml
1615 projects
elm
856 projects
reason
219 projects

Projects that are alternatives of or similar to Hazel

Wonder Editor
Functional 3D Webgl Editor
Stars: ✭ 113 (-66.76%)
Mutual labels:  functional-programming, editor, reasonml
Omnia
Stars: ✭ 81 (-76.18%)
Mutual labels:  functional-programming, editor
Oni2
Native, lightweight modal code editor
Stars: ✭ 6,704 (+1871.76%)
Mutual labels:  editor, reasonml
Revery Playground
Live, interactive playground for Revery examples
Stars: ✭ 14 (-95.88%)
Mutual labels:  functional-programming, reasonml
Wonder.js
🚀Functional, High performance 3D Webgl Engine
Stars: ✭ 225 (-33.82%)
Mutual labels:  functional-programming, reasonml
Graphql ppx
GraphQL PPX rewriter for Bucklescript/ReasonML
Stars: ✭ 325 (-4.41%)
Mutual labels:  reasonml
Underscore Java
java port of Underscore.js
Stars: ✭ 327 (-3.82%)
Mutual labels:  functional-programming
Effect
effect isolation in Python, to facilitate more purely functional code
Stars: ✭ 324 (-4.71%)
Mutual labels:  functional-programming
Mua
An open source markdown editor for Android.
Stars: ✭ 318 (-6.47%)
Mutual labels:  editor
Tsec
Type-safe general-cryptography library - https://jmcardon.github.io/tsec/
Stars: ✭ 338 (-0.59%)
Mutual labels:  functional-programming
Darkmatter
The notebook-style Common Lisp environment
Stars: ✭ 336 (-1.18%)
Mutual labels:  editor
Stackedit
In-browser Markdown editor
Stars: ✭ 18,744 (+5412.94%)
Mutual labels:  editor
Here Be Dragons
An Intellij/Android Studio plugin to help visualise side effects in your code.
Stars: ✭ 325 (-4.41%)
Mutual labels:  functional-programming
Gubrak
⚙️ Golang functional utility library with syntactic sugar. It's like lodash, but for Go
Stars: ✭ 329 (-3.24%)
Mutual labels:  functional-programming
Synedit
SynEdit main project
Stars: ✭ 324 (-4.71%)
Mutual labels:  editor
Qilin App
Fully hackable text editor developed for exact sciences with built-in KaTeX and AsciiMath support. Extensible via plugins and themes. Exportable as HTML, PDF and GFM.
Stars: ✭ 336 (-1.18%)
Mutual labels:  editor
Vertx Zero
Zero Framework:http://www.vertxup.cn
Stars: ✭ 320 (-5.88%)
Mutual labels:  functional-programming
Swiftz
Functional programming in Swift
Stars: ✭ 3,327 (+878.53%)
Mutual labels:  functional-programming
Vue Designer
Vue component design tool
Stars: ✭ 333 (-2.06%)
Mutual labels:  editor
Magic In Ten Mins
十分钟魔法练习
Stars: ✭ 327 (-3.82%)
Mutual labels:  functional-programming

Hazel Build status: dev Build status: trunk

Hazel Mascot

Hazel is a live functional-programming environment rooted in the principles of type theory. You can find the relevant papers and more motivation at the Hazel website.

You can try Hazel online with either the trunk or dev version. Note that the trunk branch is updated infrequently and is currently almost two years behind!

Building and Running Hazel

Short version

If you already have ocaml version 4.08.1 and least version 2.0 of opam installed, you can build Hazel by running the following commands.

To run Hazel, run the command make echo-html, which will print a filename. Then use your preferred browser to open that file. For convenience, the following make targets open the corresponding browser or invoke the corresponding command immediately (see INSTALL.md):

  • make firefox
  • make chrome
  • make chrome-browser
  • make chromium
  • make chromium-browser
  • make win-chrome
  • make win-firefox
  • make xdg-open
  • make open

Long Version

If you are unfamiliar with ocaml or opam, do not have them installed, or just get stuck, we recommend you follow the step-by-step installation instructions contained in INSTALL.md.

Contributing

From OCaml to ReasonML

This link lets you type OCaml and see what the corresponding ReasonML syntax is: https://reasonml.github.io/en/try.

This is useful if you are trying to figure out the ReasonML syntax for something that you know the OCaml syntax for.

Suggested Extensions for VS Code

Most of our team uses VisualStudio Code to write code. If you use VS Code, here are a few extensions that might be helpful.

Build System Details

Hazel is implemented in Reason (a dialect of OCaml) and is compiled to Javascript for the web browser via the js_of_ocaml compiler.

Though make targets are provided as a convenience, they mostly translate to dune commands.

Invoking make by itself is equivalent to invoking make dev. With these commands we pass additional flags to js_of_ocaml that cause the insertion of comments that map locations in the generated JS to locations in the source files. This is useful for debugging purposes.

make dev also auto-formats Reason source files using refmt (this is what the @src/fmt alias is for). This ensures code from all contributors follows the same style.

The make dev and make release commands do three things:

  1. Generate some internal parsers using menhir.
  2. Compile the Reason code to OCaml bytecode using the OCaml compiler.
  3. Compile the OCaml bytecode to JavaScript (_build/default/src/hazelweb/www/hazel.js) using js_of_ocaml.

Debugging

You can print to the browser console using the standard print_endline function. This is probably the easiest method right now.

js_of_ocaml does support source maps and has some other flags that might be useful. If you experiment with those and get them to work, please update this README with some notes.

Testing

You can run all of the unit tests located in src/hazelcore/test by running make test.

Unit tests are written using ppx_expect and ppx_inline_tests. If you would like to adjust your expect tests to assert for the output that was last printed, run make fix-test-answers.

If the inline test runner causes problems for you, you can likely resolve the issue by running opam update then opam upgrade.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].