sz0 has quit [Quit: Connection closed for inactivity]
jeromegn has quit [Ping timeout: 252 seconds]
maxpowa has quit [*.net *.split]
andrewzah has quit [Ping timeout: 260 seconds]
Vexatoast has quit [Ping timeout: 260 seconds]
Vexatos has joined #crystal-lang
andrewzah has joined #crystal-lang
maxpowa has joined #crystal-lang
Vexatos has quit [Ping timeout: 240 seconds]
Vexatos has joined #crystal-lang
maxpowa has quit [*.net *.split]
<oprypin>
achou11, try reinstalling brew package
alex`` has joined #crystal-lang
<FromGitter>
<achou11> Still doesn’t work when I uninstall and reinstall crystal-lang in Homebrew :/
<FromGitter>
<achou11> @oprypin
<oprypin>
do that for the mentioned lib then
maxpowa has joined #crystal-lang
<FromGitter>
<bararchy> How would I do Matrix multiplaction in Crystal? Ruby has it's own Matrix class which Crystal lacks, is there any shard or any way to easily do it?
<FromGitter>
<bararchy> did Crystal had Matrix and then lost it?
<oprypin>
yes
<oprypin>
exilor/matrix iirc
<oprypin>
was previously part of Crystal
<oprypin>
@bararchy
<FromGitter>
<bararchy> Oh, why was it put out?
<FromGitter>
<bararchy> it seems like kinda useful thing
<oprypin>
git log src/matrix.cr
<oprypin>
not as frequently useful as other things
<oprypin>
what are you trying to do?
<oprypin>
hash of tuples or array of arrays can work nicely
<FromGitter>
<bararchy> I need Matrix multiplaction for a Neural Network implamentation :)
<oprypin>
ok nevermind then
flaviodesousa has joined #crystal-lang
happycoder has joined #crystal-lang
happycoder has quit [Client Quit]
happycoder has joined #crystal-lang
happycoder2 has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
jeromegn has joined #crystal-lang
happycoder2 has quit [Ping timeout: 248 seconds]
happycoder has quit [Ping timeout: 252 seconds]
mark_66 has joined #crystal-lang
<FromGitter>
<simenge> Does anyone have any experience with Crystal on Windows (Bash on Ubuntu on Windows/Linux subsystem)? I can compile stuff just fine, but I run into problems with dependencies, shards and specs. I assume it has something to do with bash env variables, but I don't have a clue where to even begin to address it.
<FromGitter>
<bararchy> Does Hash have some kind of #.uniq! ability ?
<crystal-gh>
[crystal] trofi opened pull request #5423: Makefile: allow passing through LDFLAGS to final link phase (master...master) https://git.io/vby1B
<FromGitter>
<straight-shoota> @simenge Yes, works like a charm
<crystal-gh>
[crystal] MakeNowJust opened pull request #5424: Fix to work formatting `foo.[bar] = baz` (master...fix/crystal-format/work-dot-bracket-equal) https://git.io/vbyDs
greengriminal has joined #crystal-lang
<crystal-gh>
[crystal] MakeNowJust opened pull request #5425: Fix a tiny typo in comment (master...fix/crystal/type-in-comment) https://git.io/vbyDg
<FromGitter>
<bew> @RX14 I did the same "mistake" of commenting on the commit instead of the pr (on the phone), it's when you click on a specific commit message in the pr's conversation view, you go on the commit page (and can comment here), to comment on the pr's diff you need to go on the "Changes" tab, and comment there..
<RX14>
yeah I realised after I did it
<FromGitter>
<bew> Not sure what the "correct" way to do it, now that I think about it, probably none, let's just be careful ˆˆ
<FromGitter>
<bew> Are on IRC on your phone? If yes, which client are you using?
<Yxhuvud>
bararchy: what would such a method do?
<FromGitter>
<bararchy> well, nothing good now that I think about it becasue Hash already overwrite former similar entries
<RX14>
which has a note "WARNING: this shard initialy implemented the now obsolete JsonWireProtocol, but should be compatible with the W3C Webdriver spec."
<FromGitter>
<bararchy> Just found it with you, thanks RX14
<RX14>
Papierkorb, because macros run before you can possibly now the size of things?
<Papierkorb>
sizeof(Void*) should be well known
<RX14>
yes there are some cases where it's possible
<RX14>
theoretically
<RX14>
but that doesn't mean we can allow it in all cases
<RX14>
why do you need that in a macro anyway Papierkorb ?
<Papierkorb>
cause size notation for lib unions is broken and doesn't allow for a constant right under it scope-wise containing that
<Papierkorb>
Without a macro
<RX14>
what do you mean size notation?
<Papierkorb>
>> A = sizeof(Void*); lib B; union C; f : UInt8[A]; end; end;
<RX14>
doesn't UInt8[sizeof(Void*)] work?
<Papierkorb>
> BUG: unknown node in TypeLookup: sizeof(::Pointer(Void)) SizeOf
<Papierkorb>
I take that as "no"
<RX14>
oops
<RX14>
Papierkorb, you'll just have to use bits32 and bits64 to define constants as a workaround
<RX14>
and avoid sizeof entirely
<Papierkorb>
Interestingly enough, it can't access constants from a sibling module/class either, but if the constant is in a parent scope, that's fine
<Yxhuvud>
papierkorb: do you need that actual size in macro time or could you wrap it in a regular method that you use in the macro?
<RX14>
Papierkorb, I'm not sure it's possible that the size of one structure can depend on a sizeof call
<RX14>
it makes me think of all the edge cases
<Papierkorb>
RX14: Sure it's possible for most types. You can restrict in lib on basic types, and those have well known sizes
<RX14>
Papierkorb, did you try using :: to specify the full constant path
<Papierkorb>
It's not like I want a sizeof(MyArbitraryType)
<RX14>
Papierkorb, yeah sizeof() for basic scalars is definitely doable
<RX14>
we just need to encode that rule
<Papierkorb>
Oh and allowing constant calculations as part of integer generic values would be great
<RX14>
Papierkorb, i suggest you open an issue
<RX14>
allow sizeof() on simple scalars inside type definitions and macros
<RX14>
and wherever they're not allowed
Guest19095 has joined #crystal-lang
happycoder has joined #crystal-lang
alex`` has quit [Ping timeout: 246 seconds]
<Guest19095>
so quiet in crystal land
alex`` has joined #crystal-lang
<Papierkorb>
People are coding stuff .. or buying stuff
<Guest19095>
haha, i have some story
<Guest19095>
i have been develop some large app
<Guest19095>
with crystal
<Guest19095>
and i was sick on middle of my app development
<Guest19095>
and there is nobody can doing stuff with crystal
<FromGitter>
<simenge> @straight-shoota, how did you manage to get shards and spec to work? When I try to install dependencies, "require" can't find them, and when I try to run spec, I get the error message /usr/bin/ld: cannot find -lxml2". I've tried sudo apt-get install libxml2, but still, so it is present on the system, but ld cannot find it
<FromGitter>
<straight-shoota> You need `libxml2-dev`, not just `libxml2`
<FromGitter>
<simenge> I believe I followed all the steps - like I said, I can compile just fine, I just can't get shards or spec to work - but I might have missed some necessary step
<FromGitter>
<simenge> Gonna give it a try and see if it works
happycoder has quit [Ping timeout: 252 seconds]
<FromGitter>
<straight-shoota> shards should work out of the box. Do the depencies get installed in the `./lib` folder?
<FromGitter>
<simenge> Yes they do. But I can't get them to work, even if I try to require them via an absolute path
happycoder has joined #crystal-lang
<FromGitter>
<straight-shoota> I'm not sure require supports absolute paths
<FromGitter>
<simenge> Weird. I removed all the code that didn't work, so I'll have to try and reproduce the issue later. First I'll see if I can get spec working
<FromGitter>
<simenge> I did, but not in quite that format
<FromGitter>
<simenge> it was more like "require 'minitest/minitest'" which I copied from a tutorial
danielpclark has quit [Quit: Leaving]
<FromGitter>
<simenge> Spec now works! Nice, thanks a lot @straight-shoota. It was apparently the missing dev version of libxml2 that was the culprit
bew has joined #crystal-lang
happycoder has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
happycoder has joined #crystal-lang
<crystal-gh>
[crystal] RX14 opened pull request #5428: Use shards version in crystal init tool (master...feature/template-shards-version) https://git.io/vbSUS
rohitpaulk has quit [Ping timeout: 240 seconds]
swav has quit [Ping timeout: 248 seconds]
rrr has joined #crystal-lang
swav has joined #crystal-lang
fiete has quit [Ping timeout: 248 seconds]
rrr has quit [Client Quit]
dostoyevsky has quit [Ping timeout: 248 seconds]
dostoyevsky has joined #crystal-lang
fiete has joined #crystal-lang
happycoder has quit [Ping timeout: 248 seconds]
<Guest19095>
yup
<crystal-gh>
[crystal] cotsog opened pull request #5429: Enable IPv6 in Docker (master...patch-1) https://git.io/vbSY8
<Papierkorb>
Because there's no String#<<. But that snippet doesn't look like a good usage of Hash.
pabs has quit [Ping timeout: 248 seconds]
<FromGitter>
<MrSorcus> > **<Papierkorb>** Because there's no String#<<. But that snippet doesn't look like a good usage of Hash. ⏎ ⏎ Why?
<Papierkorb>
It using Symbol as key alone is a give-away. Why do you use Symbol?
<FromGitter>
<MrSorcus> > **<Papierkorb>** It using Symbol as key alone is a give-away. Why do you use Symbol? ⏎ ⏎ Because i can :-D ⏎ Ok, replace key symbol to string, but still works only with `.as(Type)` [https://gitter.im/crystal-lang/crystal?at=5a3beb545355812e57024e8a]
alex`` has quit [Quit: WeeChat 2.0]
<Papierkorb>
That doesn't answer the question why you're using Hash
<Papierkorb>
Using Symbol is a good indicator that a newbie is doing things wrong, shooting their own foot
<FromGitter>
<bew> What are you trying to store?
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter>
<MrSorcus> This just an example. ⏎ Add strings or integers for get something like this - `@hash={"string" => "Hello World", "array" => [1, 2, 3, 4, 5, 6]}`
alex`` has joined #crystal-lang
<Papierkorb>
For that, .as is the answer. And it feels wrong, which is why you want to avoid it. Static typing helps you to reason about your program, don't "disable" it if you don't have to
<Papierkorb>
Hash is mainly a DTO (Data Transfer Object) to communicate with remote or internal clients. The only moment it's useful as DSO (S = Storage) is when you actually do need its dynamic nature. Lookup-Hashes are such a use-case. But even there you want to get back into the world of static types as fast as you can.
<FromGitter>
<MrSorcus> I don't want to disable it. But I thought that pointing `Array(Int32)` & `String` in the property hash would be enough...
<Papierkorb>
No, the compiler can't know that your key really does point to an array in all cases
<Papierkorb>
This is true for dynamic languages as well. So Crystal just saved you from a potentional bug before it could even happen
<FromGitter>
<MrSorcus> Ok, thank for your answers. :-)
<Papierkorb>
Meanwhile on the mailing list, people founded a slack channel to split the community further
<FromGitter>
<mverzilli> we're aware of all that's not gone great this year, but I'd reflect on whether throwing innuendos helps in any way
pabs has joined #crystal-lang
<FromGitter>
<jwaldrip> @mverzilli sorry, just a bad day and looking for a ray of sunshine.
<FromGitter>
<mverzilli> no prob, we all are :)
claudiuinberlin has joined #crystal-lang
<crystal-gh>
[crystal] RX14 opened pull request #5431: Always print backtrace on error inside fork (master...bugfix/fork-exception-handler) https://git.io/vbSPj
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
Guest19095 has joined #crystal-lang
<jsn->
if I want to index an array by a enum, do I have to use .value, no way around it?
<Papierkorb>
Yes. Why do you need that?
<Papierkorb>
is that data constant or dynamic?
<jsn->
not sure; i guess i want something like this: i have a enum for directions [North, West, South, East], and i want the type checker to make sure i only index e.g. some logic lookup tables only using that enum as an index
<jsn->
not sure if i'm expressing it clearly
<FromGitter>
<bew> So you have a hash with 0 to 4 entries?
<jsn->
like, i think nim can use ranges as index-type when defining arrays, which is probably close
<jsn->
no, i have a StaticArray with 4 entries, why would i want hash for that?
<Papierkorb>
jsn-: Is that data dynamic? Do you need to change the data?
<jsn->
Papierkorb, what data do you mean?
<Papierkorb>
Does the data need change, or is it basically constant? from what data is the array constructed?
<jsn->
o_O data in the arrays changes, yes
<jsn->
why does it matter?
<Papierkorb>
Because most likely an array is not what you need, and if you help me help you you can actually get a decent solution out of it.
<Papierkorb>
Use a case statement.
<FromGitter>
<Fryguy> jsn-: are you saying you want to do `some_array[Directions::West.value]` but want to avoid the `.value` part of the syntax?
<FromGitter>
<Fryguy> assuming that North is always the 0 index, West is always index 1, etc ?
<jsn->
Fryguy, more or less, yes; ideally, i also want a compile error when i try to use some_array[1] instead of some_array[West]
<FromGitter>
<Fryguy> You *could* use a Tuple of 4 Directions (but that doesn't solve the indexing issue), or maybe a NamedTuple if you don't really need a literal enum for anything else
<jsn->
Papierkorb, i don't know; imagine I have a robot on a rectangular grid, behaviour encoded in (mutable) set of rules for each direction it might be facing, worldview represented as a set of adjacent object in each direction, state includes current direction, etc
<Papierkorb>
[22:18] <Papierkorb> Use a case statement.
<jsn->
Fryguy, yeah, tuple doesn't change much, and with named i lose the ability to store a direction in a var?
<jsn->
Papierkorb, what, each time I need a lookup?
<Papierkorb>
That's what a function is for?
<Papierkorb>
`when North then {x, y-1}` is nice and clean. replace it with logic as needed.
<jsn->
that obviously won't work with (dynamic) behaviour tables above?
<Papierkorb>
Of course what would work?
<Papierkorb>
How is it harder to write a case statement than it is to write an array containing all logic, while a case only calculates what's needed
<jsn->
integers would work, of course
<jsn->
an array containing all logic is a given, it comes from the outside world, i don't write it, it's dynamic, i can't write it as a static case statement
<Papierkorb>
Then what's your issue now? You reject the notion of using statically checkable code structures, you reject hashes.
<Papierkorb>
This is a XY if I ever saw one
rohitpaulk has joined #crystal-lang
<Papierkorb>
Most logic isn't that dynamic as you first might think. Pretty much almost everything dynamic can be described in OOP patterns. Giving you stability, reasonability, testability and debugability. Hence why I'll always recommend using code structures over dynamic structures.
<Papierkorb>
You can easily build your own type doing just that if you so insist.
<jsn->
it's pretty easy; with that, i get type error if i try to index 'capital' by integers, i can store country in a var, and the array access is as efficient as a usual array
<Papierkorb>
I'm out, really. I don't think whatever I say will have an impact, and thus, I'll cede.
rohitpaulk has quit [Ping timeout: 256 seconds]
<Papierkorb>
Build such a (generic) structure yourself, it's trivial in Crystal. Others n' me gave other solutions on top of that.
<jsn->
building it myself was obvious from the start, i never asked if i can do that, really :)
<jsn->
i was asking if there's any builtin thing that can do that, and a simple no satisfies my curiousity perfectly, thanks :)
<FromGitter>
<Fryguy> yeah, enums cannot be used directly as Array indexes :)
vivus has left #crystal-lang ["Leaving"]
<jsn->
Fryguy, yeah, i figured as much :)
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
<FromGitter>
<CodeTrooperMC> This project looks awesome. Is it coming for Windows anytime soon?
<RX14>
if you want to follow along with the status
<RX14>
it's coming, maybe it'll be ready in 3-6 months
<Papierkorb>
Interesting timing for someone new asking about Windows support
<RX14>
@straight-shoota BTW I modified your wiki page a bit
<Papierkorb>
CodeTrooperMC, besides using a Linux VM, iirc people have had success using Crystal through WSL if you want to try it before it getting "full" windows support
<RX14>
and yes this
<FromGitter>
<CodeTrooperMC> Good to hear! What do you mean about my timing?
<oprypin>
CodeTrooperMC, initial Windows support was merged yesterday
<Papierkorb>
CodeTrooperMC, Early stage Windows support was just merged yesterday into master
<oprypin>
:|
<RX14>
yesterday?
<RX14>
seems longer than that
<RX14>
lol
<FromGitter>
<jwaldrip> @straight-shoota how do you do the JSON output for docs?
<RX14>
it's in master @jwaldrip
<RX14>
well
<RX14>
0.24.0/0.24.1
<FromGitter>
<jwaldrip> im using master. whats the command?
<RX14>
it's always generated
<RX14>
into docs/index.json
<FromGitter>
<jwaldrip> ah okay
<FromGitter>
<jwaldrip> now i see it
<RX14>
i think json doc explicitly is coming later
<RX14>
or maybe its already in
<RX14>
nope
<RX14>
it's not in
<crystal-gh>
[crystal] bew opened pull request #5434: Fix formatting of lib's fun starting with uppercase letter (master...fix-uppercase-fun-formatting) https://git.io/vbSFF
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter>
<vectorselector> my apologies if this is the wrong place to drop this: ⏎ Interesting strategic analysis of WEBASM for the Rust community... being a fellow LLVM language it could be interesting vis-a-vis Crystal lang: ⏎ https://mgattozzi.com/rust-wasm
<crystal-gh>
[crystal] Sija opened pull request #5435: Remove _invariant macro from Float::Printer::* modules (master...remove-disguised-assert) https://git.io/vbSx9
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
<Papierkorb>
We're pretty different to Rust. There are plenty things keeping Crystal from being wasm-able in the current state of wasm.
<oprypin>
rust no gc no fibers
_whitelogger has joined #crystal-lang
<crystal-gh>
[crystal] Sija opened pull request #5436: Let Complex inherit from Number (master...make-complex-a-number) https://git.io/vbSjl
rohitpaulk has joined #crystal-lang
DTZUZO has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
<crystal-gh>
[crystal] Sija opened pull request #5437: Add `Number#/(other : BigFloat)` overload (master...number-div-with-bigfloat) https://git.io/vbSjb