Giter VIP home page Giter VIP logo

goji's People

Contributors

engil avatar eyyub avatar klakplok avatar yetanotherion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

goji's Issues

callback and option_null arg seems to generate wrong syntax code

Hi,

The following code do not compile and seems to generate an .ml file with a wrong syntax:

callback [curry_arg "alarm" ((option_null (abbrv "alarm")) @@ arg 0)] void

In the ml file generate by goji:

  (callback
       if (Goji_internal.js_equals args'0 (Goji_internal.js_null)) then (
           None
        ) else (
           (Some  (extract_alarm args'0))
        ));

Can you tell me if my code is not good or if in fact it's an error made by goji ?

If not, we just have to add parentheses to make it valid :

(callback
     (if (Goji_internal.js_equals args'0 (Goji_internal.js_null)) then (
          None
        ) else (
          (Some  (extract_alarm args'0))
         )));

It's done by adding () in goji_pprint.ml format_if function:

(* before *)
let format_if cond bt bf =
  group
    (group (!^"if " ^^ align cond ^^ !^" then (")
     ^^ nest 2 (break 1 ^^ bt) ^^ break 1 ^^ !^") else ("
     ^^ nest 2 (break 1 ^^ bf) ^^ break 1 ^^ !^")")
(* after *)
let format_if cond bt bf =
  group
    (group (!^"(if " ^^ align cond ^^ !^" then (")
     ^^ nest 2 (break 1 ^^ bt) ^^ break 1 ^^ !^") else ("
     ^^ nest 2 (break 1 ^^ bf) ^^ break 1 ^^ !^"))")

I can make a pull request but as I don't know if we have to add some () all around in goji_pprint.ml, I will not by precaution ! :D

Excuse me if I was wrong btw !

Thanks, Eyyub.

Document how to build larger Goji binding projects

I'm attempting to see how Goji scales to binding to a larger library—in particular, the Meteor framework. It's a significantly larger project than any of the example Goji bindings, but I don't think it's out of scope.

Unfortunately, I run into a lot of issues trying to figure out how to make Goji run with a larger project. As a simple example, it took me some time to realize that when breaking a binding into multiple modules I need to separately compile a .cmxs file for each module and then list them all to goji generate

ocamlbuild -use-ocamlfind all.cmxs  # depends on Tracker.ml
ocamlbuild -use-ocamlfind tracker.cmxs
goji generate -d bindings _build/tracker.cmxs _build/all.cmxs

I can try to dig into the Goji source more deeply to understand how everything is being generated, but it'd be nice to know if there are any larger bindings through Goji I could use as an example or if there is any documentation for how to use Goji "practically".

Thanks!

Can't compile the current version

Hello,
I'm trying to use Goji, but when I do make, I get the following errors

OCAMLPATH=. ocamlfind ocamlopt -g -package dynlink,str,unix,pprint,cmdliner,goji_lib,findlib -c goji_pprint.ml
File "goji_pprint.ml", line 9, characters 21-27:
Error: Unbound value column

I don't know if it comes from pprint, I'm using the latest version from Opam.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.