Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not compile it #1

Open
zjhmale opened this issue Aug 24, 2015 · 1 comment
Open

can not compile it #1

zjhmale opened this issue Aug 24, 2015 · 1 comment

Comments

@zjhmale
Copy link

zjhmale commented Aug 24, 2015

when i use

lein uberjar

it came out the excepiton

java.lang.Exception: Insufficient bytes to decode frame., compiling:(compiler.clj:693:1)
    at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3628)
    at clojure.lang.Compiler.compile1(Compiler.java:7323)
    at clojure.lang.Compiler.compile(Compiler.java:7390)
    at clojure.lang.RT.compile(RT.java:399)
    at clojure.lang.RT.load(RT.java:444)
    at clojure.lang.RT.load(RT.java:412)
    at clojure.core$load$fn__5448.invoke(core.clj:5866)
    at clojure.core$load.doInvoke(core.clj:5865)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5671)
    at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
    at clojure.core$load_lib.doInvoke(core.clj:5710)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:632)
    at clojure.core$load_libs.doInvoke(core.clj:5749)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:632)
    at clojure.core$require.doInvoke(core.clj:5832)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojit.core$loading__5340__auto____21.invoke(core.clj:1)
    at clojure.lang.AFn.applyToHelper(AFn.java:152)
    at clojure.lang.AFn.applyTo(AFn.java:144)
    at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3623)
    at clojure.lang.Compiler.compile1(Compiler.java:7323)
    at clojure.lang.Compiler.compile1(Compiler.java:7313)
    at clojure.lang.Compiler.compile(Compiler.java:7390)
    at clojure.lang.RT.compile(RT.java:399)
    at clojure.lang.RT.load(RT.java:444)
    at clojure.lang.RT.load(RT.java:412)
    at clojure.core$load$fn__5448.invoke(core.clj:5866)
    at clojure.core$load.doInvoke(core.clj:5865)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5671)
    at clojure.core$compile$fn__5453.invoke(core.clj:5877)
    at clojure.core$compile.invoke(core.clj:5876)
    at user$eval9$fn__16.invoke(form-init8682481342482979395.clj:1)
    at user$eval9.invoke(form-init8682481342482979395.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6782)
    at clojure.lang.Compiler.eval(Compiler.java:6772)
    at clojure.lang.Compiler.load(Compiler.java:7227)
    at clojure.lang.Compiler.loadFile(Compiler.java:7165)
    at clojure.main$load_script.invoke(main.clj:275)
    at clojure.main$init_opt.invoke(main.clj:280)
    at clojure.main$initialize.invoke(main.clj:308)
    at clojure.main$null_opt.invoke(main.clj:343)
    at clojure.main$main.doInvoke(main.clj:421)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:383)
    at clojure.lang.AFn.applyToHelper(AFn.java:156)
    at clojure.lang.Var.applyTo(Var.java:700)
    at clojure.main.main(main.java:37)
Caused by: java.lang.Exception: Insufficient bytes to decode frame.
    at gloss.io$decode.invoke(io.clj:85)
    at gloss.io$decode.invoke(io.clj:79)
    at clojit.dumb$cljbc_format_by_map.invoke(dumb.clj:87)
    at clojit.dumb$dumb_buffer.invoke(dumb.clj:241)
    at clojit.compiler$c.invoke(compiler.clj:682)
    at clojure.lang.AFn.applyToHelper(AFn.java:154)
    at clojure.lang.AFn.applyTo(AFn.java:144)
    at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3623)
    ... 50 more

and i found that after i comment this line of code it worked and everything is fine so there must be something goes wrong in this function

@nickik
Copy link
Member

nickik commented Aug 24, 2015

Thanks for your interest. We have only last week agree to make a binary output and I hacked this code together while camping.

The main problem is that I do not fully under how the gloss matching works.

The problem is in the code that maches my output datastructure to the gloss codec, cljbc-format.

I have some problem encoding "(repeated (string :utf-8))" but to decode you have to use "(repeated (string :utf-8) :delimiters ["\0"])". So when preparing the datastructure that we feed to the cljbc-format we have to null terminate all the strings, so that we can more ealy work with them in the C version of the VM.

We have to match the output of strings-vec-data (https://github.com/clojit/clojit-c/blob/master/src/clojit/dumb.clj#L224) be the correct input for https://github.com/clojit/clojit-c/blob/master/src/clojit/dumb.clj#L224 of the gloss codec.

I actually hope to finish this code tomorrow, it needs a lot of cleanup because I developed a different version and both of the code is still around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants