jerome.martin.dev
2019-4-9 08:34:47

@thegobinath There’s none yet, but I’m working on it: https://github.com/euhmeuh/web-galaxy On the other hand, a static site generator like https://github.com/greghendershott/frog is getting popular, but it’s not a “web framework” per se.


jerome.martin.dev
2019-4-9 08:36:28

I feel like it’s so simple to make your own from the basic racket/web-server package that everyone makes its own brew.


jerome.martin.dev
2019-4-9 08:38:16

But as a beginner, I felt a bit lost because it doesn’t look like a classic web server the first time you try it. There’s all those strange concepts of continuations and all… Then you get to understand that continuations are not really necessary, and you start making your own wrapper around the server.


jerome.martin.dev
2019-4-9 08:39:42

With web-galaxy, I want to provide an easy access to that technology, without the fuss and the complexity of having to read the documentation line-by-line in the right order


jerome.martin.dev
2019-4-9 08:42:34

In the end, one usually just wants to define some routes and serve them, keeping the complexity for later


jerome.martin.dev
2019-4-9 08:45:42

Then I want to add support for javascript modules and web components


jerome.martin.dev
2019-4-9 08:46:42

So that you can write javascript as racket (using the urlang package) and generate your full web application from that


jerome.martin.dev
2019-4-9 08:49:36

Maybe I won’t have time to do all that in my spare time, but if I can inspire others to try something like that, and create traction, that’d be good enough.


thegobinath
2019-4-9 08:51:18

Ok. Will try it out.


githree
2019-4-9 08:54:46

@jerome.martin.dev curious, what are your ideas for html dsl, I remember your talk at fosdem https://github.com/euhmeuh/fosdem-2019-talk/blob/master/slides.pdf are you still planning on something similar to page 34?


jerome.martin.dev
2019-4-9 08:55:29

Yep!


jerome.martin.dev
2019-4-9 08:55:59

A DSL that would permit to describe the HTML template, the javascript, the database fetching…etc all in one part of the code


githree
2019-4-9 08:56:23

that would be my dream come true :slightly_smiling_face:


githree
2019-4-9 08:58:09

one thing I always found annoying about xexp is the nesting of the attributes


githree
2019-4-9 08:58:32

what I personally like is the approach of laml


githree
2019-4-9 08:58:51

are you aware of that old library?


soegaard2
2019-4-9 08:59:21

githree
2019-4-9 09:00:12

at-expr is one neat approach


soegaard2
2019-4-9 09:00:18

Note that the above doesn’t build an s-expression, but represents the html using structs.


jerome.martin.dev
2019-4-9 09:02:20

The at-expr approach is nice, but I feel like there’s a bit too much @ x) Joke aside, I’m not fixed on the notation yet, but I guess I want to make it as transparent as possible


soegaard2
2019-4-9 09:02:55

Yeah - It’s tricky to find a good balance.


soegaard2
2019-4-9 09:03:19

The more text (non-html) you need the better it gets.


githree
2019-4-9 09:03:34

in laml (div ([class "pony"]) (pony-name the-pony)) becomes (div 'class "pony" (pony-name the-pony))


githree
2019-4-9 09:03:43

which is also something I like


jerome.martin.dev
2019-4-9 09:03:54

laml is great yeah, I had something like that in mind


jerome.martin.dev
2019-4-9 09:05:52

What I really want to promote is the “duality of syntax” that Doug Hoyte writes about in Let Over Lambda


jerome.martin.dev
2019-4-9 09:06:56

make it so that there’s no difference between writing code and writing template, and that both can be intertwined seamlessly


githree
2019-4-9 09:09:10

especially now with web components it seems even more doable


jerome.martin.dev
2019-4-9 09:09:14

yep


jerome.martin.dev
2019-4-9 09:11:50

I’ve been waiting for web components to finally be implemented by every browser for a long time now. But some times ago a colleague shared the link to an article explaining how a big banking company used web components for all the website, and only had a polyfill for Internet Explorer, making it possible to actually use web components in production for every browser. And I was like “OK, now’s the time!”


githree
2019-4-9 09:15:37

How do you see web-galaxy working with the multiplicity of Javascript MV* frameworks (current and future)


jerome.martin.dev
2019-4-9 09:17:13

I guess it could be agnostic. But I’m really trying to push forward vanilla JS, because with ES6 + web components and shadow DOM, a lot of those frameworks have superfluous parts.


jerome.martin.dev
2019-4-9 09:18:07

Especially since Racket works exactly as Babel for Javascript : it makes a perfect transpiler through macros.


jerome.martin.dev
2019-4-9 09:19:03

My challenge is to try using only standard browser features instead of writing an MVC framework


jerome.martin.dev
2019-4-9 09:19:26

I don’t know if that’s possible, but I wanna try and find out were it goes


githree
2019-4-9 09:20:02

that would be ideal but seems like a challenge


githree
2019-4-9 09:21:07

so far every time I wanted to write a web app entirely in Racket after some time I had to move into pure Javascript as it was getting more and more complex to keep it in both worlds


githree
2019-4-9 09:21:30

So in essence you are thinking more about svelte approach?


jerome.martin.dev
2019-4-9 09:21:49

I’m striving for minimalism :slightly_smiling_face:


githree
2019-4-9 09:21:53

but with Racket as transpiler


jerome.martin.dev
2019-4-9 09:22:33

Yep, pretty much something like that


githree
2019-4-9 09:25:01

great to hear all that, and fingers crossed (as that would be brilliant)!


jerome.martin.dev
2019-4-9 09:27:27

I’m glad to hear that :smile: Let’s just hope I have enough brain-time for all that :stuck_out_tongue: When I have a full working proof of concept, I’d be glad to share it here.


githree
2019-4-9 09:32:19

brain-time is an excellent combination - why is that that we either have enough brain and not enough time or enough time and not enough brain? :grin:


jerome.martin.dev
2019-4-9 09:34:35

I so agree with that :stuck_out_tongue:


leif
2019-4-9 10:28:19

@mflatt So, after looking at mred/private/wx/common/event, it looks like it’d be fairly simple to breate events into something like racket/event.


leif
2019-4-9 10:29:11

If so, would it make sense to move events to the main racket repo (and have the gui-lib one reprovide them), or would it make more sense to add a new package to the distrobution, or something else?


leif
2019-4-9 10:30:00

Or, I guess, it’d also be possible to make a racket/gui/event collection, and just document that that collection can be instantiated multiple times unlike racket/gui/base.


mflatt
2019-4-9 10:44:18

Yes, racket/gui/event within gui-lib sounds like the right idea for now.


leif
2019-4-9 10:47:24

Alright, I’ll prepare a PR, thanks.


greg
2019-4-9 15:38:26

@jbclements @samth winooski seems downski again?


notjack
2019-4-9 15:39:11

@jerome.martin.dev regarding html syntax, what do you think of using keyword arguments for attributes? (div #:class "pony" (pony-name the-pony))


jerome.martin.dev
2019-4-9 15:41:33

Yep, using keyword arguments is definitely the most “racketty” to me


jerome.martin.dev
2019-4-9 15:42:09

I think I’m gonna go with that


notjack
2019-4-9 15:51:08

nice, then they can be normal functions too


jbclements
2019-4-9 15:52:42

@greg right you are, and for exactly the same reason. I believe Stephen Chang is working on bringing it back up. Perhaps this time I won’t crash it again.


greg
2019-4-9 15:54:47

What are you running on winooski, some kind of Elizabeth Barrett Browning AI to compute all possible ways to express HTML using Racket? :smile:


jbclements
2019-4-9 15:55:19

just trying to run the branch build, sigh.


greg
2019-4-9 15:55:56

I’m sorry. It sounds frustrating and my bad humor is probably not helping.


jbclements
2019-4-9 15:58:46

on the contrary! A little gallows humor is always appreciated! :slightly_smiling_face:


lexi.lambda
2019-4-9 16:28:15

@jbclements Has branch day happened? From GitHub, it looks like the answer is “yes”, but I want to make sure. I’m trying to figure out if it’s safe for me to merge something to master without it ending up in v7.3.


jbclements
2019-4-9 16:39:15

@lexi.lambda yes, the catalog is built, the release branch exists, and master is now on 7.3.0.1. so merges to master should not wind up in the release by default.


lexi.lambda
2019-4-9 16:39:25

Great, thank you!


leif
2019-4-9 17:17:19

@mflatt Actually, looking at it a bit more, it looks like (afaict anyway) ‘most’ of mred/private/wx/common can be instantiated more than once.


leif
2019-4-9 17:17:39

(Except for stuff like queue.rkt, which I think is because of the use of atomic mode?


daniel
2019-4-9 17:56:19

Hey everyone. I’m still getting into Racket, but I love it so far. In my search for information as to whether Racket supports persistent data structures [1] I came across this article [2] from 2010. I was wondering how many of the Racket criticisms in the article still held true. Don’t get me wrong: I’m definitely on Team Racket. :slightly_smiling_face: I’m just curious as to how Racket may have changed since the article was written.

But going back to my initial quest, does Racket support any sort of persistent data structure, one that preserves the previous version of itself when it is modified?

I guess that’s two questions, but perhaps in answering the first, the second may be answered as a side-effect.

[1] <https://en.wikipedia.org/wiki/Persistent_data_structure> [2] <https://programming-puzzler.blogspot.com/2010/08/racket-vs-clojure.html>


githree
2019-4-9 17:59:22

as to the persistence there are some packages: https://pkgd.racket-lang.org/pkgn/search?q=persistent


daniel
2019-4-9 18:01:40

Oh, thank you @githree! The problem with being new to a space is not even knowing where to look for answers. I appreciate the link.


samth
2019-4-9 18:01:41

@daniel there are lots of persistent data structures in Racket.


samth
2019-4-9 18:02:29

it’s still true that by default, Racket come with a few built-in data strucutures, and only one of the default ones is a sophisticated modern persistent data structure (functional hashes)


daniel
2019-4-9 18:03:20

Thanks, @samth. I’ll look into functional hashes. Great information,


githree
2019-4-9 18:03:37

it’s also worthwhile to use github language:racket for finding some interesting code: https://github.com/search?q=language%3Aracket+persistent


soegaard2
2019-4-9 18:05:22

lexi.lambda
2019-4-9 18:07:19

@daniel As Sam already said, Racket’s immutable hash datatype is a HAMT, which is the same way Clojure implements its maps. In addition to that, I implemented Clojure’s persistent vector data structure in Racket as the pvector package, here: https://docs.racket-lang.org/pvector/index.html And there are other persistent data structures available in various packages, too.


daniel
2019-4-9 18:15:26

This is all great information. I rarely get excited about a language (I’ve been doing this for longer than most of you have been alive :slightly_smiling_face:) but I must admit, Racket’s really taking hold of my brain. I have a lot to learn here, but to paraphrase Tank from The Matrix, it’s a very exciting time! Thanks again, everyone.


soegaard2
2019-4-9 18:22:20

is flattered to be considered young


pocmatos
2019-4-9 18:36:26

@lexi.lambda thanks for your email on racket-dev. Currently trying to get kids in bed. I have a solution to the problem, which have been lazily delaying implementing it. Thanks for the nudge. Will get done tomorrow morning - i.e. in the next 12 hours. Will reply to the mailing list as well explaining the mitigation and future plans.


lexi.lambda
2019-4-9 18:36:54

No worries, it isn’t a big deal!


jaz
2019-4-9 18:37:59

FYI, in racket-on-chez, the immutable hash is a patricia trie


samth
2019-4-9 18:49:03

@jaz oh interesting. I thought it was still a HAMT


jaz
2019-4-9 18:49:53

We tried (er, no pun intended) both (and a HAMT is still in the repo, I believe). The HAMT does have better memory usage but it’s slower on most operations.


jaz
2019-4-9 18:51:42

My best guess is that this is because creating a new HAMT node involves creating a new vector (which also has to zero out the memory) and then vector-set!-ing the whole thing. So, each slot is written to twice, and each write has to go through a GC write barrier. But this is really just a guess.


samth
2019-4-9 18:55:44

I don’t think the zeroing would trigger the write barrier, but that’s all very interesting


jaz
2019-4-9 18:56:01

No, you’re right. Only the second write goes through the barrier.


jaz
2019-4-9 19:15:22

BTW, one of my reasons for suspecting vector writes as the culprit is that a version of the HAMT that stores a cons cell (containing the name/value pair) in each slot performed better than one that uses a flat vector twice the size.


soegaard2
2019-4-9 19:16:02

Apropos, did Chez get immutable cons cells?


jaz
2019-4-9 19:17:14

I don’t think so


samth
2019-4-9 20:04:20

racket immutable conses are just chez mutable conses


soegaard2
2019-4-9 20:14:23

ok


greg
2019-4-9 20:51:44

It seems like mirror is tougher to fix today than yesterday. :disappointed:


greg
2019-4-9 20:52:43

My own bad luck these two days I had a chunk of time to do/push many commits, and Travis CI decided to CRON build Frog.


mflatt
2019-4-9 22:17:21

Many things prevent multiple instantiation. Some of it is that global hooks are installed or global classes (for Objective-C) defined. Some of it is that GUI toolkits do not support running in multiple OS threads.


jbclements
2019-4-9 22:25:12

Can I ask which service it is that you’re depending on here? Is it the catalog?


jbclements
2019-4-9 22:25:25

Sorry should have said @greg on that previous message


jbclements
2019-4-9 22:43:08

@greg … no, catalog seems to be intact. Is it just the main racket download?


a.pelenitsyn
2019-4-9 22:43:29

@a.pelenitsyn has joined the channel


a.pelenitsyn
2019-4-9 22:54:57

in NEU PRL, http://mirror.racket-lang.org\|mirror.racket-lang.org is currently used to download Racket inside Travis, and we can’t get to it today


greg
2019-4-9 23:05:32

@jbclements https://mirror.racket-lang.org/installers/7.2/racket-7.2-x86_64-linux.sh isn’t connecting, and that is the main/default download link (also used by stuff like Travis CI tests)


greg
2019-4-9 23:05:54

(but also by humans who want to download Racket)


jbclements
2019-4-9 23:07:33

@a.pelenitsyn yep, working on it…


greg
2019-4-9 23:09:16

Thanks. Don’t mean to nag, just want to make sure you know it’s down now. (Like, yesterday it was fixed in a few hours, so, it seems plausible it might have been fixed today, but went back down again w/o anyone noticing yet.)


mflatt
2019-4-9 23:31:05

For now, we’ve made the default download link point to the Utah mirror. That doesn’t help with Travis CI configurations, though.


greg
2019-4-10 00:00:20

@mflatt OK, I did similar.


travis.hinkelman
2019-4-10 05:26:27

I was trying to calculate an element-wise sum of a nested list and bumped up against a gap in my (very limited) understanding. Here is a simple example: &gt; (define x '((1 2 3) (4 5 6) (7 8 9))) &gt; (apply map list x) '((1 4 7) (2 5 8) (3 6 9)) &gt; (apply map + (apply map list x)) '(6 15 24) The first results was as I expected. But I thought that I could then pass that new nested list to a similar (apply map) structure and get '(12 15 18). Is there a simple explanation for what is happening here? Or can someone point me to the relevant section in the docs? Thanks.


lexi.lambda
2019-4-10 05:57:07

@travis.hinkelman (map f as bs cs) ends up producing (list (f a_1 b_1 c1_) (f a_2 b_2 c_2) ... (f a_n b_n c_n)). (apply map list x) therefore performs (map list (list 1 2 3) (list 4 5 6) (list 7 8 9)), producing (list (list 1 4 7) (list 2 5 8) (list 3 6 9)). Now, you pass that value to (apply map + ....), leading to the function call (map + (list 1 4 7) (list 2 5 8) (list 3 6 9)), which produces (list (+ 1 2 3) (+ 4 5 6) (+ 7 8 9)), just as before, which eventually reduces to (list 6 15 24).


lexi.lambda
2019-4-10 05:58:55

Put another way, (apply map f lsts) “zips” up the lists in lsts using f, so the nth element of the result list becomes the result of applying f to the nth element of each argument lists.


lexi.lambda
2019-4-10 06:00:17

As it happens, this works out to mean (apply map list lsts) “transposes” lsts, so that if you view it as a two-dimensional list, it flips the axes.


lexi.lambda
2019-4-10 06:02:54

Anyway, if you wanted to get (list 12 15 18), then you don’t want to transpose the original x value at all: you just want to call (apply map + x), which does the “zipping” along the appropriate axis, leading to (list (+ 1 4 7) (+ 2 5 8) (+ 3 6 9)). Or, if you wanted to turn the transposed list into (list 12 15 18) directly, you could write (map (lambda (lst) (apply + lst)) (apply map list x)), which would produce the same result.