Joxa and N2O

99 views
Skip to first unread message

ma...@synrc.com

unread,
Oct 8, 2013, 4:41:46 PM10/8/13
to erlware-...@googlegroups.com
Hello!

We really like joxa and found it's implementation very clean.
However we want to make to move from Erlang Core to Abstract Format.
We have Erlang to JavaScript compiler and its implemented as parser transform.
Have Joxa compiled to Erlang AST would lead us to free Joxa to JavaScript implementation.
We use Erlang to JavaScript compiler in our N2O Web Framework on WebSockets,
a Nitrogen optimized fork. Some companies use N2O in production.

We created binding for N2O in Joxa and ported our chat sample:

(ns lispchat (require erlang joxa-core n2o wf))

(defn+ body() [(n2o/panel   {:id :history})
               (n2o/textbox {:id :message})
               (n2o/button  {:id :send}
                            {:body "Chat"}
                            {:postback :chat}
                            {:source [:message]}) ])

(defn+ main() [(n2o/dtl {:app :n2o_sample}
                        {:file "index"}
                        {:bindings [{:title "Title"} {:body (body)}]})])

(defn+ speak(m) (wf/insert_bottom :history (n2o/span {:body m})))

(defn+ event(body)
    (case body
        (:init (speak ["Hello" (n2o/br)]))
        (:chat (speak [(wf/q :message) (n2o/br)]))))

N2O bindings:
Sources available with our n2o_sample: 

Everyone who like joxa would find this example useful which allows you
to write JavaSript aware WebSocket application with HTML DSL with REST and easy.

Second, thing I want to write is that we have plan to move Joxa compiler from
Erlang Core to Abstract Format, however for such a big thing we need to freedom,
maybe incompatible fork, or even another name. We can dedicate some time for it,
because we want to see not only Erlang to JavaScript compiler but also
Lisp to JavaScript on BEAM, in best tradition of Clojure to really free Applications
and spread them to client side. Please inform us if you are interested in it.

For now, have a nice hacking with Joxa! It is really best lisp on BEAM (Yet;).
Save Lisp for a great good :)

-- 
Maxim Sokhatsky
Synrc Research Center

Eric Merritt

unread,
Oct 8, 2013, 5:05:38 PM10/8/13
to erlware-...@googlegroups.com
Maxim,

I have actually been thinking seriously about migrating the backend
of Joxa to Erlang AST for a long time. By compiling to core erlang we
loose the ability to make use of things like dialyzer. So that is
something that is likely to happen. Though I am not super sure when.
Joxa is up for some refactoring soon.

Btw, is your erlang to javascript compiler open source somewhere?

Eric
> --
> You received this message because you are subscribed to the Google Groups
> "erlware-questions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to erlware-questi...@googlegroups.com.
> To post to this group, send email to erlware-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/erlware-questions.
> For more options, visit https://groups.google.com/groups/opt_out.

Eric Merritt

unread,
Oct 8, 2013, 5:24:10 PM10/8/13
to erlware-...@googlegroups.com
btw, where you guys offering to do the work?

Eric Merritt

unread,
Oct 8, 2013, 6:26:30 PM10/8/13
to erlware-...@googlegroups.com
Maxim,

Sorry maxim. I finally read your last paragraph completely. So I have
no problem with you guys doing the work and I am open to changing
joxa. I hope you don't do it as a fork, but rather as a set of PRs
back to joxa itself. That said, joxa is apache licensed so its well
within your rights to fork.

Eric

Максим Сохацький

unread,
Oct 9, 2013, 11:03:19 AM10/9/13
to erlware-...@googlegroups.com
> Btw, is your erlang to javascript compiler open source somewhere? 


Here is example of usage:


And also you can read about it at http://synrc.com/framework/web/macros.htm

JavaScript/OTP is used in production but not finished.
It works only on code snippets level as macros, not on level of modules and
application -- that is target task.
Reply all
Reply to author
Forward
0 new messages