workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
elmlang
general
it's asynchronous communication between multiple processes.
2019-02-05T03:29:39.897400
Earlean
elmlang
general
how far are mutually recursive values/functions banned in 0.19? I have values wrapped in `\() -> ...` lambdas, but that doesn't seem to help
2019-02-05T10:26:05.900500
Saran
elmlang
general
the obvious case `x = x` is always banned, and more intricate cases are only allowed in top-level definitions
2019-02-05T10:27:58.901300
Virgie
elmlang
general
so inside let-bindings there are further checks
2019-02-05T10:28:11.901600
Virgie
elmlang
general
`Elm will allow recursive definitions as long as there is at least one lambda before you get back to yourself.` but I have that
2019-02-05T10:30:56.901900
Saran
elmlang
general
like, `let a = (\() -> b); b = (\() -> a) in a` is banned?
2019-02-05T10:31:32.902700
Saran
elmlang
general
iirc, there are some exceptions to that rule with `let` nesting.
2019-02-05T10:31:47.903000
Teddy
elmlang
general
I don't remember why, I just know I've seen it happen.
2019-02-05T10:32:00.903500
Teddy
elmlang
general
When I was playing with this awhile back it seemed inconsistent. I suspect the compiler is not entirely consistent on this yet.
2019-02-05T10:32:13.903900
Dede
elmlang
general
switching it over to `a () = b` works
2019-02-05T10:32:45.904200
Saran
elmlang
general
but only if both are of that form, if either is a lambda, it fails
2019-02-05T10:33:08.904700
Saran
elmlang
general
the underlying reason is future garbage collection. top-level recursion is fine because these definitions are allocated once and are kept around, but when recursive definitions are defined in let-blocks then they have to be garbage-collected when the function returns. it is hard to correctly free a recursive definition
2019-02-05T10:42:13.906600
Virgie
elmlang
general
what are my options then? y combinator?
2019-02-05T10:45:02.906900
Saran
elmlang
general
giving up?
2019-02-05T10:45:08.907100
Saran
elmlang
general
:confused:
2019-02-05T10:45:24.907300
Saran
elmlang
general
Why would you need this?
2019-02-05T10:45:43.907600
Danika
elmlang
general
I'm building an interpreter, so I need the environment to contain a reference to the function I'm executing, so I can call it recursively
2019-02-05T10:47:38.908400
Saran
elmlang
general
I'd go the y combinator route myself.
2019-02-05T10:49:10.908800
Teddy
elmlang
general
how would you express mutual recursion in terms of the y combinator in elm?
2019-02-05T10:49:35.909300
Saran
elmlang
general
¯\_(ツ)_/¯
2019-02-05T10:49:50.909500
Teddy
elmlang
general
:tada:
2019-02-05T10:49:55.909700
Saran
elmlang
general
if I had higher-kinded types I could write a type class for it
2019-02-05T10:50:21.910100
Saran
elmlang
general
why do I keep hurting myself like this? :joy::sob::joy::sob::joy:
2019-02-05T10:54:47.911100
Saran
elmlang
general
I broke it ``` This `inlineFunctions` value is a: Expr -> Expr But `map` needs the 1st argument to be: Expr -> b ```
2019-02-05T11:05:39.911400
Saran
elmlang
general
<@Saran>if you're still looking for feedback, could you put a toy example of your recursion problem into Ellie?
2019-02-05T11:20:29.912200
Dede
elmlang
general
<@Dede> I'm trying to get it to a state where I can show it to other people, will put it on github
2019-02-05T11:21:52.913100
Saran
elmlang
general
Gotcha.
2019-02-05T11:22:01.913300
Dede
elmlang
general
Oh that’s awesome, i’d love to see what you’re working on at some point
2019-02-05T11:25:49.913900
Danika
elmlang
general
Once I finish this paper I’m working on I’m going to start implementing a new language and was going to use elm as the parser
2019-02-05T11:28:57.915000
Danika
elmlang
general
That was usually the Haskell Hello World - implement your own language.
2019-02-05T11:31:55.915700
Niesha
elmlang
general
what are you going to use that language for?
2019-02-05T11:44:57.916000
Saran
elmlang
general
Music programming / live coding :slightly_smiling_face:
2019-02-05T11:55:13.916300
Danika
elmlang
general
cool, what kind of type system are you going to use?
2019-02-05T11:57:42.916700
Saran
elmlang
general
weak/implicit/dynamic. You typically don’t want to be worrying about types as a musician or performer
2019-02-05T12:02:53.917400
Danika
elmlang
general
Please keep me in the loop about this. I’m a big fan of multimedia languages.
2019-02-05T12:04:30.917600
Cammy
elmlang
general
Well do! The audio graph things I’ve been working on in elm are part of the ground work i need to do first :slightly_smiling_face: My research is all about music programming languages ^^
2019-02-05T12:07:36.917800
Danika
elmlang
general
solved it :slightly_smiling_face:
2019-02-05T14:30:19.918800
Saran
elmlang
general
Are there any JSON encoding benchmarks? Couldn’t find anything. Wondering for the special case where you need to encode lots of data to pass to JS (either vía ports or web component prop). It is probably a very niche use case, still thinking about doing some tests myself if I can’t find anything
2019-02-05T16:02:53.922700
Bebe
elmlang
general
Hi, is there a way to use Elm to generate js code, not just for the front end, for node for example? Thanks
2019-02-05T16:22:55.924300
Ammie
elmlang
general
Not really. You could try using `Process.worker` and try running the js bundle in node and see what happens
2019-02-05T16:30:55.926100
Danika
elmlang
general
You can run a headless `Platform.worker` program in Node and communicate via ports. <https://package.elm-lang.org/packages/elm/core/latest/Platform#worker>
2019-02-05T16:32:48.926900
Jin
elmlang
general
Oh it does actually work in node?!
2019-02-05T16:33:00.927300
Danika
elmlang
general
I wasn’t sure how coupled the elm runtime was to the browser
2019-02-05T16:33:13.927700
Danika
elmlang
general
There is no view there, no DOM dependency. People use it to build CLIs.
2019-02-05T16:34:12.928500
Jin
elmlang
general
`elm-test` is a good example of a place where most people use it without realizing
2019-02-05T16:34:57.928600
Huong
elmlang
general
Like <https://github.com/stil4m/elm-analyse> or <https://github.com/zwilias/elm-xref>
2019-02-05T16:35:29.929000
Jin
elmlang
general
Elm/http becomes an issue, tho.
2019-02-05T16:37:14.929700
Cammy
elmlang
general
Yo that's awesome
2019-02-05T16:48:29.929900
Danika
elmlang
general
<@Jin> Good point, it looks like Analyser.elm is using the worker way. I'll look into that. Thanks.
2019-02-05T16:51:35.930700
Ammie
elmlang
general
This has changed everything! :smile:
2019-02-05T16:53:11.930900
Danika
elmlang
general
Hello :wave: I'm wondering if there's a way to search for packages that are 0.19 compatible on <https://package.elm-lang.org>? I've been working a bit with posix and dates and keep getting 0.18 packages.
2019-02-06T01:58:48.932700
Isabel
elmlang
general
<@Isabel> if you search on <https://package.elm-lang.org> you'll only get packages that are compatible with 0.19
2019-02-06T02:02:06.933400
Earlean
elmlang
general
the 0.18 packages are hidden from the search but can still be accessed and found via google etc.
2019-02-06T02:03:08.934100
Earlean
elmlang
general
Thanks <@Earlean>, i must have been confused with my Google searching
2019-02-06T03:06:02.935800
Isabel
elmlang
general
Does Node Elm have events/update cycle? Or is it only like a "single run"?
2019-02-06T03:24:32.937700
Nana
elmlang
general
<https://dmy.github.io/elm-0.18-packages/> isn’t ?
2019-02-06T03:26:40.937800
Liza
elmlang
general
Its not “Node Elm”, its just a Platform.worker which is just an Elm app with no view function
2019-02-06T03:32:04.939400
Danika
elmlang
general
So yeah you get the elm runtime with msgs/update
2019-02-06T03:32:19.940200
Danika
elmlang
general
ports and subs too
2019-02-06T03:32:32.940800
Liza
elmlang
general
It can - you just don't get messages from views (because there are none). Other than that, you still have ports, subs and the other builtin effects like Time or random, etc
2019-02-06T03:32:55.941400
Huong
elmlang
general
oh right, cool :open_mouth: so I guess you would just go through Node with ports for everything?
2019-02-06T03:33:24.942100
Nana
elmlang
general
and Node can talk to everyhing :smile:
2019-02-06T03:33:45.942900
Nana
elmlang
general
Pretty much, though it really depends on what you need to do. To be clear, Elm is primarily made for the browser/web, but (through `worker`) it _can_ be used in different situations, too. It's just not as smooth an experience.
2019-02-06T03:35:08.944500
Huong
elmlang
general
My query about how tied to the browser the elm runtime is was because I thought the whole thing ran in a requestanimationframe
2019-02-06T03:36:06.945500
Danika
elmlang
general
yeah, I'm probably not going to try making a server with it :stuck_out_tongue:
2019-02-06T03:37:25.946600
Nana
elmlang
general
it depends on how much do you need from server, if there is more logic than api than it can easy done, problem - is when you need lot of ports..
2019-02-06T03:38:49.947600
Liza
elmlang
general
then “elm-server” become 90% ports and 10% elm
2019-02-06T03:39:12.948100
Liza
elmlang
general
<https://github.com/justgook/p2pElm> not best example - but here is elm used as worker (server in browser) + express app for communication, and elm app for client, so you can start server in browser, then by using express-app find other players, and connect between using webRTC (all connects to one elm.worker)
2019-02-06T03:44:33.950500
Liza
elmlang
general
W-what
2019-02-06T03:46:10.950800
Danika
elmlang
general
<https://justgook.github.io/p2pElm/#/> - have no clue - does it work today…
2019-02-06T03:57:31.951300
Liza
elmlang
general
From chrome same browser can connect two tabs..
2019-02-06T03:58:35.951800
Liza
elmlang
general
Isn't?
2019-02-06T04:00:04.952700
Earlean
elmlang
general
also there is zero images, forgot to mention using <https://developer.mozilla.org/en-US/docs/Web/API/EventSource> to get handshake from clients (no WS / longpooling)
2019-02-06T04:00:39.953400
Liza
elmlang
general
Ah, the question I answered was deleted
2019-02-06T04:01:39.953800
Earlean
elmlang
general
i mean - each time when you search for some 0.18 package it suggest you to jump to this link and you can find all 0.18 packages here..
2019-02-06T04:01:41.954000
Liza
elmlang
general
Neato. Does switching browser tabs stop P2P from working if you are the "server" ?
2019-02-06T04:02:28.954900
Renda
elmlang
general
have no clue..
2019-02-06T04:05:41.955100
Liza
elmlang
general
that was just PoC - that i can create p2p communication using webrtc and elm
2019-02-06T04:06:11.955700
Liza
elmlang
general
Hello, everyone! Couldn't you point out the best way to send and receive WebSockets in Elm? I know there is an official package but it's currently outdated
2019-02-06T04:19:48.957300
Else
elmlang
general
<@Else> there's bad news, and kinda good news on that front: the bad news is that there isn't in pure elm anymore. The good news is that you can totally do it with JavaScript and use ports to communicate with your elm app.
2019-02-06T04:21:13.958700
Antonette
elmlang
general
should we update <https://en.wikipedia.org/wiki/Elm_(programming_language)> a bit? kinda feels weird that tea is not referenced
2019-02-06T04:22:01.959700
Desire
elmlang
general
Tea?
2019-02-06T04:22:26.960300
Antonette
elmlang
general
Even calling it a DSL seems off imo
2019-02-06T04:22:27.960400
Danika
elmlang
general
The elm architecture
2019-02-06T04:22:31.960600
Danika
elmlang
general
Oh. TEA.
2019-02-06T04:22:36.960800
Antonette
elmlang
general
sorry :smile:
2019-02-06T04:22:48.961100
Desire
elmlang
general
:wink:
2019-02-06T04:22:52.961300
Antonette
elmlang
general
I'd say it deserves an update indeed.
2019-02-06T04:23:09.961700
Antonette
elmlang
general
Thanks. Anywhere I can look up how to do it with js?
2019-02-06T04:23:41.961800
Else
elmlang
general
In pure JS: <https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications>
2019-02-06T04:25:14.962200
Antonette
elmlang
general
btw - for websockets would be nice have `task port` :drevil:
2019-02-06T04:25:54.962900
Liza
elmlang
general
The frontend side is not really complicated, the most complicated thing you might have to do is keep the socket alive by sending messages from time to time so it doesn't die (and I recommand keeping this in pure JS because there's not much advantages writing it in Elm).
2019-02-06T04:27:05.964500
Antonette
elmlang
general
websockets stay alive by it self.. problem is that you don’t know when they die..
2019-02-06T04:28:29.966900
Liza
elmlang
general
Haha, yeah definitely only using ports it is possible. Will try to write an article on how to use WS in elm
2019-02-06T04:28:32.967100
Else
elmlang
general
(If I manage to get it working...)
2019-02-06T04:28:59.967800
Else
elmlang
general
&gt; WS in elm ```app.ports.send.subscribe (ws.send) ws.onmessage(app.ports.receive.send)```
2019-02-06T04:30:56.968900
Liza
elmlang
general
where `ws` - is your always-live-ws
2019-02-06T04:31:16.969300
Liza
elmlang
general
<https://github.com/justgook/PrintersWorkshopUI/blob/develop/src/js/Connection.js> - found example - about how to keep WS always live..
2019-02-06T04:33:54.970500
Liza
elmlang
general
Lovely. Will try the examples when I am home
2019-02-06T04:35:02.971400
Else
elmlang
general
* that example is 3y old - but i think it is kind of clear how it works (maybe for me - because i wrote it… )
2019-02-06T04:37:05.972100
Liza