Skip to content

gthvn1/olox_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An Interactive Coding Toy in OCaml

OCaml Interactive Coding

Project Name: TBD — For now, just "OCaml HTTP Server"! OLox Server

The idea is to have some fun with OCaml, and since I want to build something interactive, why not create a small server that serves a page with three panels? The user can enter code in one panel, and the other two will be used to display output and any errors.

For now, our OCaml server can serve a basic index.html page and handle a simple transformation of input text using ROT13 🙂... Everything is wired up — now it's just a matter of improving and expanding it!

Next steps: we'll follow the Crafting Interpreters book to parse and evaluate Lox code from the input panel.

Status

Tricks

  • To get doc in my terminal I'm using: w3m "$(odig cache path)/html/index.html"
    • of course you need to have odig installed...
  • To run the server: dune exec olox_server
  • And for testing:
❯ curl http://localhost:8000/jOe
Hello jOe!
  • But to truly immerse yourself in the experience open it in your browser 🤸

OCaml Interactive Coding Screenshot

About

An Interactive Coding Playground for the Lox Language, in OCaml

Topics

Resources

License

Stars

Watchers

Forks

Contributors