<FromGitter>
<watzon> I don't want to pollute the top level namespace by defining them outside of the module, but I also would rather not have to do `ModuleName.macro_name` to call the macro
<FromGitter>
<Blacksmoke16> if you actually include it
<FromGitter>
<watzon> Damn
<alexherbo21372>
It is not specified, but does the same rule applies to Process.run(cmd) than system(cmd) (which can spawn a shell if it contains space)
<FromGitter>
<kaukas_gitlab> Hello! Is there any standard way to limit the amount of memory a crystal process can allocate, and then force GC to clean up? My script is leaking memory somewhere, or the GC is simply not cleaning up old objects. How could I debug that?
<FromGitter>
<j8r> because Erlang threads, as said in your articles, aren't OS threads
<FromGitter>
<j8r> other names for similar technologies are green threads, goroutines, fibers etc
<FromGitter>
<j8r> it's clearly mentioned "system thread" in the doc
<ShalokShalom>
no
<ShalokShalom>
read "A Fiber"
<FromGitter>
<j8r> what's the sentence?
<ShalokShalom>
the thing is that you assume preemptive means OS threads
<FromGitter>
<j8r> > A fiber is in a way similar to an operating system thread except ...
<ShalokShalom>
"the advantage of"
<ShalokShalom>
And "A Fiber is much more lightweight as a thread"
<FromGitter>
<j8r> Ok so you would like to clarify this "Fibers, unlike threads, are cooperative. Threads are pre-emptive" to "Fibers, unlike OS threads, are cooperative. OS Threads are pre-emptive"
<FromGitter>
<j8r> and every place `threads` is, to clarify that's OS threads
<ShalokShalom>
yes
<ShalokShalom>
something like this
<ShalokShalom>
maybe even mentioning there are other threads
<FromGitter>
<j8r> I think it's quite obvious, because only OS threads are mentioned before
<ShalokShalom>
and the benefits of an auto healing system, which is only possible with preemptive scheduling
<ShalokShalom>
yeah, if you read that section before
<ShalokShalom>
I was reading just tat mentioned section, since I was interested about how Crystal implements that
<ShalokShalom>
otherwise, you are correct, of course
<FromGitter>
<j8r> you can submit a PR an see what other people think, why not
ShalokShalom has quit [Remote host closed the connection]
<mps>
j8r: you want to have pre-emptive fibers?
ShalokShalom has joined #crystal-lang
<ShalokShalom>
why has Crystal an incomplete type inference?
<FromGitter>
<Blacksmoke16> hm
<ShalokShalom>
why do I have to type out types sometimes?
<ShalokShalom>
opposed to total type inference on any item
<FromGitter>
<Blacksmoke16> because its a statically typed language?
<FromGitter>
<Blacksmoke16> ah
<ShalokShalom>
OCaml?
<ShalokShalom>
F#?
<ShalokShalom>
Haskell?
<ShalokShalom>
Elm?
<ShalokShalom>
they type infer everything
<FromGitter>
<Blacksmoke16> its a feature to allow typing when needed but isnt required to have method args or local vars typed all the time
<FromGitter>
<Blacksmoke16> well this isnt any of those so not a good comparison :)
<ShalokShalom>
I ask why this is
<ShalokShalom>
and not if this a good comparison
<ShalokShalom>
Pony has also complete type inference and its more imperative / object oriented
<FromGitter>
<Blacksmoke16> i dont have an exact reason, but that was just one of the goals of the lang `Be statically type-checked, but without having to specify the type of variables or method arguments.`
<ShalokShalom>
yes, I know
<ShalokShalom>
I ask for the reason, why this is not the case yet :)
<ShalokShalom>
Incomplete is nice, more than nothing :D
<FromGitter>
<Blacksmoke16> `yet`, its not going to be ever
<FromGitter>
<Blacksmoke16> its by design
<ShalokShalom>
Aha?
<FromGitter>
<Blacksmoke16> as i just said, its a goal of the lang `Be statically type-checked, but without having to specify the type of variables or method arguments.`
<mps>
how to infer 'x = 1', what is it: int32 or int64
<ShalokShalom>
So you dont know why it is how it is, while you know it will stay so?
<FromGitter>
<Blacksmoke16> its inferred to be Int32
<ShalokShalom>
mps: How do you type inference?
<ShalokShalom>
Hindler-Milner?
<FromGitter>
<Blacksmoke16> `x : Int32 = 1`
<ShalokShalom>
*Hindley
<FromGitter>
<Blacksmoke16> now its restricted to Int32
<ShalokShalom>
you infer it from the context, of course
<mps>
Blacksmoke16: yes, I know, but what if think it is int64, obviously wrong
<FromGitter>
<Blacksmoke16> thats the feature, you dont *HAVE* to give a local variable a type restriction, but you can
<ShalokShalom>
and you can look up how other languages are doing that
<FromGitter>
<Blacksmoke16> then you do `x = 1_i64`
<ShalokShalom>
But sometimes I need
<ShalokShalom>
In Crystal
<mps>
ofc, but then it is not inference
<ShalokShalom>
Thats the case...
<ShalokShalom>
So why is it incomplete here?
<ShalokShalom>
And complete in others
<ShalokShalom>
And why will it stay this way
<mps>
ShalokShalom: maybe by intention
<FromGitter>
<Blacksmoke16> i mean you could also do `x = 1_i64`
<ShalokShalom>
I know Rust does it also this why
<ShalokShalom>
maybe...
<FromGitter>
<Blacksmoke16> then its inferred to be Int64
<ShalokShalom>
this is computer science :D
<ShalokShalom>
thanks
<ShalokShalom>
thats not infered
<mps>
and I think it is good as it is now
<ShalokShalom>
I mean "not typin"
<FromGitter>
<Blacksmoke16> but Int32 is the default unless otherwise stated
<ShalokShalom>
Yeah, because you dont know it in any other way
<ShalokShalom>
then why not always choosing a default?
ShalokShalom has quit [Remote host closed the connection]
<FromGitter>
<Blacksmoke16> im not sure i follow anymore but the default type for numbers is Int32
<FromGitter>
<Blacksmoke16> if you dont specify otherwise
<FromGitter>
<Blacksmoke16> also assuming ist not a float
<FromGitter>
<pynixwang> alpine docker does 'nt support ssl?
<FromGitter>
<Blacksmoke16> or something like that, i dont know which specifically off hand
<FromGitter>
<pynixwang> ok
<mps>
Blacksmoke16: 'apk add ...'
<FromGitter>
<Blacksmoke16> oh right, picked the debian imagine oops
<FromGitter>
<Blacksmoke16> seems ca-certificates is the one you need tho
<FromGitter>
<Blacksmoke16> same for both
<mps>
meh, who can remember all distro's package managers syntax
<FromGitter>
<Blacksmoke16> ikr?
<mps>
what 'ikr' mean
<FromGitter>
<Blacksmoke16> i know right*
<mps>
aha, thanks
<FromGitter>
<Blacksmoke16> np
ua has quit [Ping timeout: 252 seconds]
<FromGitter>
<asterite> ShalokShalom: all the languages which have the type inference you want don't have default arguments, overloads, splats, etc. It seems that kind of type inference isn't compatible with those features
<FromGitter>
<pynixwang> alpine ssl works
<FromGitter>
<pynixwang> busybox not works
<mps>
pynixwang: alpine have ssl_client which is used as busybox 'helper' for some busybox applets, wget for example
<z64>
if you're going by the compressed size, its 9 MB. but anyways, i was more suggesting to look at that image to see if it has what you might need so that you could make something smaller
<FromGitter>
<pynixwang> alpine is ok
<FromGitter>
<pynixwang> 3 crystal binary 54M
<FromGitter>
<pynixwang> crystal binary is fat.
<FromGitter>
<pynixwang> latest fc74393ba6c7 About an hour ago 54.9MB
<FromGitter>
<j8r> jhass: at least, the benchmark must not indicate 1.13 slower or fastest if there are equal
<jhass>
so I'm getting 2.04ns with 2.4% variance and 2.62ns with 6.64% variance for example, that gives a range of 2.9ns to 2.09ns vs a range of 2.4ns 2.8ns, the smallest difference is just 0.3ns
<jhass>
that's just within measurement errors
<jhass>
if you feel the need to benchmark stuff on such a low level you have to get involved into understanding modern CPU architectures
<jhass>
and everything between your program and the CPU
<FromGitter>
<pynixwang> and why last is slow than `[-1]`
<FromGitter>
<pynixwang> last is fast
<FromGitter>
<pynixwang> sorry
ShalokShalom has joined #crystal-lang
return0e_ has quit [Ping timeout: 268 seconds]
return0e has joined #crystal-lang
<FromGitter>
<r00ster91> Is it possible to convert `<b>html markdown</b>` to `*html markdown*` with `Markdown`?
<FromGitter>
<Blacksmoke16> im thinking it goes from md to html not the other way around
<FromGitter>
<r00ster91> aww
<jhass>
fwiw any valid html is already valid markdown, no? :D
<FromGitter>
<r00ster91> I need to convert it to \*\*this\*\* markdown because that's the only markdown Discord accepts
<FromGitter>
<Prutheus> I am using Kemal: Problem: I have a post request with a lot of data (lot of images, base64 coded) .... but my Kemal is blocking this request, it is too large, how to fix that?
<FromGitter>
<Prutheus> Please help me
Yxhuvud has joined #crystal-lang
<FromGitter>
<jwoertink> @Prutheus You could use something like sidekiq, or mosquito to break up the action in to smaller background jobs.
<FromGitter>
<j8r> ... or spawn fibers?
<FromGitter>
<j8r> And/or use multiple posts then, if possible
<FromGitter>
<mwlang> (which implements some familiar rspec concepts like let and subject and expect
<FromGitter>
<Blacksmoke16> 😐
<FromGitter>
<Blacksmoke16> did you see when it was last updated :P
<FromGitter>
<mwlang> That looks like a problem...last updated for Crystal 0.18.0, so it's been a while and it's own specs won't run...doesn't crash the compiler, but doesn't run, either.
ShalokShalom has quit [Remote host closed the connection]
bougyman has joined #crystal-lang
<FromGitter>
<Blacksmoke16> @veelenga I was thinking it would be cool to add in some automation around validating projects in awesome-crystal
<FromGitter>
<Blacksmoke16> didnt really look into it much, but idea would be like once a week/month? query travis/circleci apis (whichever they use) to determine latest build status and assert its passing within x days
<FromGitter>
<Blacksmoke16> would help enforce the automated builds, and keep the list current, as removing unmaintained/failing projects would be easier
<z64>
@Blacksmoke16 i think it might be enough to simply attach CI badges next to them. then informally, failing builds can be periodically reviewed, or others can see the failing badges as opportunities to contribute (maybe its just updating the lib for breaking changes)
<FromGitter>
<Blacksmoke16> :vince
<FromGitter>
<Blacksmoke16> that would prob be a much simpler solution :p
<FromGitter>
<Blacksmoke16> good call
<FromGitter>
<Blacksmoke16> ill make an issue for it
<z64>
cool. what you suggest might be better for like, an actual shards registry like crystalshards.xyz that already has the infra to do automated things
<z64>
(though tbf, i dont know how shards.xyz works)
<FromGitter>
<Blacksmoke16> :shrug:
<FromGitter>
<Blacksmoke16> do you know if there is a badge for like `last built`