Re: [racket-users] Re: Racket -> HTML+JavaScript using Urlang and Ractive

2016-03-20 Thread Greg Trzeciak
On Wednesday, March 16, 2016 at 10:54:50 PM UTC+1, Jens Axel Søgaard wrote:
> 2016-03-16 22:50 GMT+01:00 Greg Trzeciak :
> "Urlang is a Racket flavoured S-expression syntax for Javascript"
> 
> 
> 
> Can I steal that for a tag-line?
>  

Feel free!

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: Racket -> HTML+JavaScript using Urlang and Ractive

2016-03-19 Thread Armon Toubman
On Wednesday, March 16, 2016 at 1:57:30 PM UTC+1, Daniel Prager wrote:
> Awesomely, Jens has been working on Urlang: a Racket-ish syntax for 
> JavaScript, using the nanopass compiler infrastructure:
> 
> https://github.com/soegaard/urlang
> 
> 
> 
> and more ambitiously, a Racket (subset) ->JavaScript compiler (rjs), taking a 
> distinct approach from Whalesong.
> 
> * * *
> 
> 
> Just using plain Urlang together with sxml, Bootstrap (for css), and notably 
> Ractive.js for templating and data-binding I made the following demo / 
> proof-of-concept:
> 
> 
> http://htmlpreview.github.io/?https://github.com/danprager/urlang/blob/master/urlang-examples/ractive/ractive-bootstrap-example.html
> 
> 
> 
> Note: no heavyweight js runtime required: actually no runtime at all.
> 
> 
> 
> 
> 
> Racket source: 
> https://github.com/danprager/urlang/blob/master/urlang-examples/ractive/ractive-bootstrap-example.rkt
> 
> 
> HTML output (including embedded JavaScript): 
> https://github.com/danprager/urlang/blob/master/urlang-examples/ractive/ractive-bootstrap-example.html
> 
> The abstractions are a bit leaky, but I'm quietly excited about where this 
> sort of approach could lead.
> 
> What do you think?
> 
> 
> Dan

This looks great. Would it be possible to extend this to React Native [1], so 
we can write mobile apps in Racket?

[1] https://facebook.github.io/react-native/

Armon

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Racket -> HTML+JavaScript using Urlang and Ractive

2016-03-19 Thread Greg Trzeciak
On Wednesday, March 16, 2016 at 10:32:22 PM UTC+1, Jens Axel Søgaard wrote:
> 2016-03-16 22:18 GMT+01:00 Greg Trzeciak :
> 
> 
> Thanks Dan, seems to be exactly what I need (especially the combination with 
> ractive.js! BTW you couldn't find js framework with name more fitting to work 
> with racket ;)
> 
> I am only curious what racket subset does urlang include or rather what won't 
> work in urlang.
> 
> 
> Hi Greg,
> 
> 
> Think of Urlang as JavaScript with s-expression syntax.
> The core urlang language includes constructs that mirror JavaScript almost 
> one-to-one.
> 
> So Urlang is not "Racket to JavaScript compiler".

Got it. In other words:

"Urlang is a Racket flavoured S-expression syntax for Javascript"

Thank you for your explanation - still seems like a good fit for one of my 
projects (as I needed something more lightweight than Whalesong) so I will try 
it out shortly.

Greg


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Racket -> HTML+JavaScript using Urlang and Ractive

2016-03-19 Thread Jens Axel Søgaard
2016-03-16 22:50 GMT+01:00 Greg Trzeciak :

> "Urlang is a Racket flavoured S-expression syntax for Javascript"
>

Can I steal that for a tag-line?


> Thank you for your explanation - still seems like a good fit for one of my
> projects (as I needed something more lightweight than Whalesong) so I will
> try it out shortly.
>

Sounds great. Don't hesitate to send feedback.

/Jens Axel

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: Racket -> HTML+JavaScript using Urlang and Ractive

2016-03-19 Thread Greg Trzeciak
On Wednesday, March 16, 2016 at 1:57:30 PM UTC+1, Daniel Prager wrote:
> Awesomely, Jens has been working on Urlang: a Racket-ish syntax for 
> JavaScript, using the nanopass compiler infrastructure:
> 
> https://github.com/soegaard/urlang
> 
> 
> 
> and more ambitiously, a Racket (subset) ->JavaScript compiler (rjs), taking a 
> distinct approach from Whalesong.
> 
> * * *
> 
> 
> Just using plain Urlang together with sxml, Bootstrap (for css), and notably 
> Ractive.js for templating and data-binding I made the following demo / 
> proof-of-concept:
> 
> 
> http://htmlpreview.github.io/?https://github.com/danprager/urlang/blob/master/urlang-examples/ractive/ractive-bootstrap-example.html
> 
> 
> 
> Note: no heavyweight js runtime required: actually no runtime at all.
> 
> 
> 
> 
> 
> Racket source: 
> https://github.com/danprager/urlang/blob/master/urlang-examples/ractive/ractive-bootstrap-example.rkt
> 
> 
> HTML output (including embedded JavaScript): 
> https://github.com/danprager/urlang/blob/master/urlang-examples/ractive/ractive-bootstrap-example.html
> 
> The abstractions are a bit leaky, but I'm quietly excited about where this 
> sort of approach could lead.
> 
> What do you think?
> 
> 
> Dan

Thanks Dan, seems to be exactly what I need (especially the combination with 
ractive.js! BTW you couldn't find js framework with name more fitting to work 
with racket ;)
I am only curious what racket subset does urlang include or rather what won't 
work in urlang.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: Racket -> HTML+JavaScript using Urlang and Ractive

2016-03-19 Thread Jens Axel Søgaard
2016-03-16 22:18 GMT+01:00 Greg Trzeciak :

>
> Thanks Dan, seems to be exactly what I need (especially the combination
> with ractive.js! BTW you couldn't find js framework with name more fitting
> to work with racket ;)
> I am only curious what racket subset does urlang include or rather what
> won't work in urlang.


Hi Greg,

Think of Urlang as JavaScript with s-expression syntax.
The core urlang language includes constructs that mirror JavaScript almost
one-to-one.
So Urlang is not "Racket to JavaScript compiler".

There are few miniscule differences:
-   functions support optional arguments
-  The = operator generates === in JavaScript
-  if will only count the false  value as false (zero is not considered
to be true)

That said: Urlang does support macros, which means you can write
constructs that expand into core Urlang.

In urlang/for you will find a Racket-ish for constructs.
That is  for, for*, for/sum, for*/sum etc

https://github.com/soegaard/urlang/blob/master/urlang/for.rkt

In urlang/extra you will find some often used macros:

These constructs can be used as expressions:

; (begin0 expr statement ...)
; (when   test statement ... expr)
; (unless test statement ... expr)

; (cond [test statement ... expr] ...)
; (case val-expr clause ...)
;  where clause is  [(datum ...) statement ... expr]
;   or  [elsestatement ... expr]
; (letrec ([id val-expr] ...) statement ... expr)
; (let*   ([id val-expr] ...) statement ... expr)

;; These constructs can be used as statements:
; (swhen   test statement ...)
; (sunless test statement ...)
; (scond  [test statement ...] ...)

https://github.com/soegaard/urlang/blob/master/urlang/extra.rkt

We are working on making some more examples.

/Jens Axel

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.