These are chat archives for Gozala/wisp

24th
Sep 2014
Irakli Gozalishvili
@Gozala
Sep 24 2014 14:22
Hi @larme
larme you are right escodegen generates js right now
there are few iterations actually
So pipeline is reader emits forms
then analyzer produces AST from those forms
Irakli Gozalishvili
@Gozala
Sep 24 2014 14:28
analyzer mostly makes scope analyzes and complex form parsing normalizing it into simple data structures
those two steps are intended to be backend agnostic (although in practice that may not be the case)
in the next step (in case of escodegen) is generator, that generates JS output from AST
https://github.com/Gozala/wisp/blob/master/src/backend/escodegen/generator.wisp
Irakli Gozalishvili
@Gozala
Sep 24 2014 14:44
In case of escodegen generate consists of translating AST to JS AST and escodegen is used to generate JS output from that ast
@larme I imagine you would create lua generator
that is either generates lua code out of AST or translates it to Lua AST first and then generates code out of it
depends if there is a library that could generate lua code out of Lua AST
ven
@vendethiel
Sep 24 2014 17:28
Congratulations @Gozala !
and hello there :-)
Irakli Gozalishvili
@Gozala
Sep 24 2014 17:31
@Nami-Doc thanks :)
@Nami-Doc can you try reproducing that issue with a local install ?
ven
@vendethiel
Sep 24 2014 17:32
I'm sorry, I don't have that issue :P.
Irakli Gozalishvili
@Gozala
Sep 24 2014 17:33
@Nami-Doc ah ok, then :)
ven
@vendethiel
Sep 24 2014 17:34
Though I do have some other questions... I wanted to write a make "generate-compound-assign" that'd take a like of operators (ie '(+ - *)) and generate set-+and others like that, but I wasn't sure of how to do that
in CL I'd just concat both strings then (intern (symbol p))
(mind you, I have very little racket/cl experience, but those don't have "nice" JS backends. I love the code wisp produces!)
Irakli Gozalishvili
@Gozala
Sep 24 2014 17:36
@Nami-Doc not sure I follow exactly
do you have a clj example I can take a look at ?
ven
@vendethiel
Sep 24 2014 17:37
I don't do clojurescript; so not really
Irakli Gozalishvili
@Gozala
Sep 24 2014 17:37
@Nami-Doc oh sorry you said cl
@Nami-Doc ok let's try over again then
so what set-+ is supposed to do ?
ven
@vendethiel
Sep 24 2014 17:39
it's supposed to be
(defmacro set-+
  [name n]
  `(set! ,name (+ ,n ,name))
Irakli Gozalishvili
@Gozala
Sep 24 2014 17:40
@Nami-Doc oh give me a sec
ven
@vendethiel
Sep 24 2014 17:41
(I know I might re-evaluate side-effects, but I have no idea how to alleviate that problem or how to translate CL's solutions (that moslty uses macrolet etc, even transforming setq...))
Irakli Gozalishvili
@Gozala
Sep 24 2014 17:41
@Nami-Doc you should just swap , with ~
(defmacro set-+
  [name n]
  `(set! ~name (+ ~n ~name)))
ven
@vendethiel
Sep 24 2014 17:41
right, sorry :-).
but this part's not really the problem, it's generating macros like that that is
Wow; what happened to the online REPL?
Irakli Gozalishvili
@Gozala
Sep 24 2014 17:42
@Nami-Doc you mean http://jeditoolkit.com/try-wisp/ ?
ven
@vendethiel
Sep 24 2014 17:43
ah, thanks, I had another one. whoops!
ven
@vendethiel
Sep 24 2014 17:43
yeah, I had that one, but I much prefer try-wisp :-)
Irakli Gozalishvili
@Gozala
Sep 24 2014 17:44
try-wisp just shows compile output
it does not really runs it though
ven
@vendethiel
Sep 24 2014 17:44
Yes, that's right, it just happens to be what I want here
Irakli Gozalishvili
@Gozala
Sep 24 2014 17:44
@Nami-Doc ok
@Nami-Doc sorry I need to go, it's pretty late here
ven
@vendethiel
Sep 24 2014 17:45
alright, np :-)! See you
Irakli Gozalishvili
@Gozala
Sep 24 2014 17:45
@Nami-Doc feel free to post here & I'll reply later
ven
@vendethiel
Sep 24 2014 17:45
guess I'll try to come to gitter more often, I'm mostly on IRC
Irakli Gozalishvili
@Gozala
Sep 24 2014 17:45
or create an issue and I'll respond there
ven
@vendethiel
Sep 24 2014 17:46
I try to avoid creating issues for questions haha. Good night!
for later: so yeah as I said, this macro works fine, but I'm trying to generate it from a list of operators (swap + with others). I'm not sure how to do that? I'd like to call something like (generate-compound-assign + - *) (or maybe with quotes) and have it like that