00:04
laaron has joined #crystal-lang
00:12
ternarysolo has joined #crystal-lang
00:17
ternarysolo has quit [Ping timeout: 246 seconds]
00:50
faitswulff has quit [Remote host closed the connection]
00:52
faitswulff has joined #crystal-lang
01:27
lucasb has quit [Quit: Connection closed for inactivity]
02:33
faitswulff has quit [Remote host closed the connection]
02:34
faitswulff has joined #crystal-lang
02:34
<
FromGitter >
<bajro17> Hello I need help what is easiest way to upgrade my connection to websocket?
03:00
faitswulff has quit [Remote host closed the connection]
03:01
faitswulff has joined #crystal-lang
03:06
faitswulff has quit [Ping timeout: 250 seconds]
03:33
f1refly has quit [Ping timeout: 250 seconds]
03:47
f1refly has joined #crystal-lang
05:03
faitswulff has joined #crystal-lang
05:07
faitswulff has quit [Ping timeout: 264 seconds]
06:12
jemc has joined #crystal-lang
06:46
jemc has quit [Ping timeout: 246 seconds]
06:51
<
FromGitter >
<mehmetc> @j8r Thank you. I did some rereading on union types it is clearer now.
07:04
faitswulff has joined #crystal-lang
07:08
faitswulff has quit [Ping timeout: 250 seconds]
07:09
<
FromGitter >
<bararchy> So, I know its a long shot but anyone is coming to RSA conference in SF US? Would love to meet community people IRL
08:25
_whitelogger has joined #crystal-lang
08:40
<
FromGitter >
<j8r> @bajro17 you can upgrade to http/2, which can replace websockets
09:04
faitswulff has joined #crystal-lang
09:09
faitswulff has quit [Ping timeout: 264 seconds]
09:58
<
FromGitter >
<vladfaust> @j8r I think the question was about upgrading a GET request to websocket connection
09:59
<
FromGitter >
<j8r> yes @vladfaust , I just want to point out @bajro17 that if he uses http/2, it probably don't need websockets anymore
10:00
<
FromGitter >
<vladfaust> http/2 does not replace websockets, as of SSR (server-side events) do not allows two-way communication
10:03
ashirase has quit [Ping timeout: 250 seconds]
10:05
<
FromGitter >
<j8r> with http/1 yes, not http/é
10:06
<
FromGitter >
<j8r> > Lack of bidirectional capabilities has often been perceived as a major drawback when comparing SSE to WebSocket. Thanks to HTTP/2 this is no longer the case. This opens up the opportunity to skip WebSockets and stick to an HTTP-based signaling instead.
10:07
<
FromGitter >
<j8r> of course this depends of the use case, if you are building a very real time app - you may have better to use websockets
10:09
<
FromGitter >
<j8r> the problem is: we don't have HTTP/2 in stdlib crystal, yet 😢
10:09
ashirase has joined #crystal-lang
10:12
<
FromGitter >
<vladfaust> Server-side events still don't allow two-way communication
10:13
<
FromGitter >
<vladfaust> As a replacement you're suggesting HTTP/2 pushes and HTTP requests instead of websocket frames
10:13
<
FromGitter >
<vladfaust> It is far less efficient in terms of latency
10:15
<
FromGitter >
<j8r> yes
10:17
<
FromGitter >
<j8r> but there is HPAK compression
10:18
<
FromGitter >
<vladfaust> Agreed. Still can compres frames by yourself
10:18
<
FromGitter >
<j8r> right. Anyway in Crystal, better to use Websockets
10:39
marmotini_ has joined #crystal-lang
11:05
faitswulff has joined #crystal-lang
11:10
faitswulff has quit [Ping timeout: 268 seconds]
12:25
ternarysolo has joined #crystal-lang
12:40
faitswulff has joined #crystal-lang
13:18
laaron has joined #crystal-lang
13:19
lucasb has joined #crystal-lang
13:43
<
FromGitter >
<bajro17> I find way with help on Telegram
13:43
<
FromGitter >
<bajro17> but still cant figure out why my connection instantly close
13:54
<
FromGitter >
<j8r> Off topic: I've updated jrei/crystal-alpine Docker image
14:01
hightower2 has quit [Ping timeout: 240 seconds]
14:04
<
jokke >
j8r: i have an automated build
14:05
<
FromGitter >
<j8r> me too, but mine is based on Alpine:latest
14:06
<
FromGitter >
<j8r> so it will only build if alpine:latest has changed :/
14:07
<
jokke >
nah you can just disable cache
14:07
<
FromGitter >
<j8r> more stable, eventually production
14:07
<
jokke >
what do you mean?
14:08
<
FromGitter >
<j8r> alpine:latest is more stable than alpine:edge
14:08
<
jokke >
mine is also based on alpine:latest
14:08
<
FromGitter >
<j8r> and there is a Docker hub autobuild feature, that autobuild when the base `FROM image` is updated
14:09
<
jokke >
i just build in the ci every day
14:09
<
FromGitter >
<j8r> not really joke, you more or less update to edge
14:09
<
jokke >
because i run apk update?
14:10
<
FromGitter >
<j8r> yeah and all new dependencies come from edge
14:10
<
FromGitter >
<j8r> right?
14:10
<
jokke >
ah yeah right
14:10
<
jokke >
RUN sed -i -e 's/v[[:digit:]]\.[[:digit:]]/edge/g' /etc/apk/repositories
14:10
<
FromGitter >
<j8r> on my side I only install crystal and shards from edge, and all other dependencies comes from latest
14:11
<
jokke >
idk if that's a good idea
14:11
<
FromGitter >
<j8r> anyway, doing it manually isn't really a big deal
14:11
<
FromGitter >
<j8r> Before I was able to "watch" `crystallang/crystal`
14:11
<
jokke >
well it might work
14:11
<
FromGitter >
<j8r> not anymore :(
14:11
<
jokke >
just build it in gitlab ci?
14:12
<
FromGitter >
<j8r> Hum, why not!
14:12
<
jokke >
you can basically copy paste my build script
14:12
<
jokke >
just remember to set protected CI vars DOCKER_USERNAME and DOCKER_PASSWORD
14:14
<
FromGitter >
<j8r> wow sure
14:15
<
FromGitter >
<j8r> the worst is those pushing AWS credentials in clear - you can quickly be ruined and have thousands of dollars to pay
14:16
<
FromGitter >
<j8r> there is literally no limit of consumption, even millions to pay
14:22
<
mps >
j8r: this CI is just x86_64? or can it build aarch64?
14:24
<
FromGitter >
<j8r> I've searched for arm builds, "raw" CIs or docker based - I haven't one, yet
14:25
<
FromGitter >
<j8r> or there are hacks with qemu and chroots
14:26
<
mps >
ah, we just got multi arch drones for alpine
14:26
<
mps >
so, wanted to inform you about that nice feature
14:27
marmotini_ has quit [Remote host closed the connection]
14:27
<
FromGitter >
<j8r> multi arch drones?
14:29
<
mps >
some kind of docker builders which have multiple arch's
14:30
<
FromGitter >
<j8r> For the Alpine Linux project? cool! :)
14:32
<
mps >
not only alpine, but yes from a few days ago alpine also
14:33
<
mps >
for example if you make PR you can try build it on these drones and see results before PR goes to official builders
14:34
<
jokke >
mps: it can build on anything
14:35
<
jokke >
mps: or anything you can build the gitlab-runner for
14:35
<
jokke >
which is written in go
14:35
<
jokke >
so windows/mac/linux (x86 or arm) shouldn't be a problem
14:36
<
jokke >
gitlab itself only has x86 runners afaik
14:36
<
jokke >
but it's super easy to add your own
14:38
<
jokke >
i really really like the gitlab ci
14:38
<
jokke >
there's practically no limit to what it can do
14:44
<
mps >
jokke: it is somehow linked to github, but probably could be to gitlab also
14:45
<
jokke >
mps: what is?
14:49
<
mps >
jokke: don't understand?
14:50
<
jokke >
what is linked to github
14:50
<
mps >
ah, these drones
14:51
<
mps >
you have PR and before sending to project you check if it works using these drones
14:52
<
mps >
to be fair, I don't know how it works at lower level but looking them in action last few days
15:11
azuri5 has joined #crystal-lang
15:15
ternarysolo has quit [Ping timeout: 255 seconds]
15:20
ternarysolo has joined #crystal-lang
15:30
laaron has quit [Remote host closed the connection]
15:30
laaron has joined #crystal-lang
15:37
jemc has joined #crystal-lang
15:40
azuri5 has quit [Quit: azuri5]
15:51
moei has joined #crystal-lang
16:14
azuri5 has joined #crystal-lang
16:42
faitswulff has quit []
16:56
<
z64 >
you can use gitlab CI on github, but currently CI will not be run specifically on PRs from forks
16:56
<
z64 >
branches & prs from your own repo will run as expected
17:43
azuri5 has quit [Quit: azuri5]
18:20
ua has quit [Ping timeout: 268 seconds]
18:33
ua has joined #crystal-lang
18:58
rohitpaulk has joined #crystal-lang
19:04
chickendan has joined #crystal-lang
19:08
devil_tux has joined #crystal-lang
19:09
<
devil_tux >
anyone have an idea how to cleanly remove `<?xml version= ...` node from XML document?
19:09
<
devil_tux >
and I don't mean childrens
19:12
<
chickendan >
hey, folks! in c++ calling setvar.insert(x) returns a pair indicating presence, rust is doing the same, returning a bool. How can I avoid the two lookups in crystal when I want to take action upon encountering a duplicate value? Hashes allow procs/blocks on missing keys, but what about on existing keys?
19:13
<
chickendan >
Currently I'm checking via set.includes? and later set.add, but that's twice the work, or is crystal caching keys like lisp's sbcl is doing?
19:14
flaviodesousa has joined #crystal-lang
19:17
azuri5 has joined #crystal-lang
19:29
devil_tux has quit [Ping timeout: 250 seconds]
19:40
<
z64 >
chickendan: if you wanted to check for existing keys, i suppose you could closure a boolean flag
19:44
rohitpaulk has quit [Remote host closed the connection]
19:57
laaron has joined #crystal-lang
19:57
rohitpaulk has joined #crystal-lang
20:02
<
chickendan >
z64: Damn, I've completely overlooked the fetch method. That's a helpful one. But, well, since I'm mostly inserting some thousand keys until I hit a duplicate value, the double lookup overhead is still there, isn't it? First the fetch, then the hash[x].
20:08
rohitpaulk has quit [Remote host closed the connection]
20:08
<
chickendan >
But I can wrap it in a more convenient insert function.
20:09
<
z64 >
yeah, i suppose that is the same. no i dont think there is any api like that off the top of my head (cant look at the dlang thing atm)
20:10
<
z64 >
sounds like it
20:10
<
FromGitter >
<Sija> I meant its functionality if ported to Crystal
20:10
<
FromGitter >
<Sija> howdy!
20:10
<
sagax >
how to update crystal with crystal?
20:10
<
z64 >
but, if you look at the source Sija, it is exactly the same
20:11
<
FromGitter >
<Sija> @z64 I don't follow, same as what?
20:12
<
z64 >
the ruby method 1. checks if the value exists in the set, then 2. updates it; chickendan wants to do this in one move
20:12
<
z64 >
he is already doing what that ruby method does manually
20:12
<
FromGitter >
<Sija> oh, right
20:12
<
chickendan >
Yeah, ruby source does the same double lookup, but a different return val then self would make it easier. :)
20:13
<
FromGitter >
<Sija> in terms of performance that would probably be the same but with cleaner API
20:13
<
z64 >
yeah, it would still be a nice addition i think, and if there is an implementation detail to optimize, can be done later
20:13
<
FromGitter >
<Sija> might be worth adding it anyways
20:14
<
FromGitter >
<Sija> I'll take it :)
20:14
laaron has quit [Remote host closed the connection]
20:16
laaron has joined #crystal-lang
20:18
<
sagax >
`crystal` can self update?
20:18
<
sagax >
i have 0.27.0 version
20:18
<
FromGitter >
<Blacksmoke16> how did you install that version?
20:19
<
FromGitter >
<Blacksmoke16> as the update method depends on how it was installed
20:19
<
sagax >
i don't remember
20:20
<
sagax >
but if crystal can some like as `crystal --update` it's to be cool
20:20
<
rkeene >
sagax, If you used AppFS, you would get that for free
20:21
<
FromGitter >
<r00ster91> yes that would be very convenient but unfortunately Crystal doesn't have that
20:22
<
FromGitter >
<Sija> @sagax in short: no
20:23
<
FromGitter >
<Sija> IIRC no other language provides such feature
20:24
<
FromGitter >
<Sija> also, that would a PITA to maintain so I wouldn't count on implementing it
20:26
<
sagax >
hm, i think i just download release from github
20:26
<
sagax >
ok, i will try this
20:28
<
FromGitter >
<Sija> you can upvote and/or mention your specific usecase in case I've missed sth
20:46
azuri5 has quit [Quit: azuri5]
20:48
azuri5 has joined #crystal-lang
21:04
<
FromGitter >
<drum445> silly question, but in Ruby you can do something like ⏎ `if foo` ⏎ to check if a var exists, can you do the same in Crystal?
21:04
<
FromGitter >
<drum445> undefined local variable or method 'foo' is what i get
21:17
<
FromGitter >
<vladfaust> You haven't defined foo beforeahead
21:19
<
FromGitter >
<drum445> I can't guarantee it exists, it's in an ecr file
21:24
<
FromGitter >
<vladfaust> That's the issue
21:25
<
FromGitter >
<drum445> Not an issue
21:25
<
FromGitter >
<drum445> I want to be able to check if a var exists and then do something depending on the result
21:25
<
FromGitter >
<drum445> Do you know of a way sir?
21:26
<
FromGitter >
<Blacksmoke16> is it within a class, i.e. not top level?
21:29
<
FromGitter >
<Blacksmoke16> could you default them to nil?
21:29
<
FromGitter >
<drum445> I'd rather not if possible
21:29
<
FromGitter >
<drum445> If there's no other way that is
21:30
<
FromGitter >
<Blacksmoke16> can you use macros in ECR templates?
21:30
<
FromGitter >
<vladfaust> I don't understand how it can be undefined. `post.title` woud not compile too in this case
21:31
<
FromGitter >
<Blacksmoke16> i think thats the point
21:31
<
FromGitter >
<vladfaust> Ah, get it
21:31
<
FromGitter >
<vladfaust> Yeah, `nil` makes sense
21:32
<
FromGitter >
<Blacksmoke16> that might work?
21:32
<
FromGitter >
<Blacksmoke16> i dont know if it would in ECR land tho :shrug:
21:34
<
FromGitter >
<drum445> Cheers @Blacksmoke16 I'll try and implement it
21:34
ternarysolo has quit [Ping timeout: 244 seconds]
21:34
<
FromGitter >
<Blacksmoke16> would only work for methods tho, i.e. `@foo = "bar"` wouldnt, but `getter/property` would
22:22
<
chickendan >
Sorry, @Sija, saw the notification just now. Thanks for spearheading this, and thanks to all the others for the feedback. :)
22:25
<
FromGitter >
<Sija> @chickendan yw, clean APIs FTW :)
22:25
moei has quit [Quit: Leaving...]
22:52
_whitelogger has quit [*.net *.split]
22:52
t1|Mike has quit [*.net *.split]
23:40
_whitelogger has joined #crystal-lang
23:41
<
FromGitter >
<arnavb> Just curious, are error messages being actively worked on for the crystal compiler? Some of them are very vague and not pointing in the right direction, while others jump straight to bug in the compiler for simple mistakes.
23:42
sagax has quit [Ping timeout: 245 seconds]
23:59
<
Yxhuvud >
Do you have any examples of error messages not helping?