edwardloveall[m] has quit [Ping timeout: 260 seconds]
cptaffe has quit [Ping timeout: 260 seconds]
akaiiro[m] has quit [Ping timeout: 260 seconds]
fifr[m] has quit [Ping timeout: 256 seconds]
kixune[m] has quit [Ping timeout: 245 seconds]
kp666[m] has quit [Ping timeout: 256 seconds]
braidn[m] has quit [Ping timeout: 256 seconds]
olbat[m] has quit [Ping timeout: 276 seconds]
chkilroy has joined #crystal-lang
txdv has joined #crystal-lang
kosmonaut has joined #crystal-lang
thews has joined #crystal-lang
tilpner has joined #crystal-lang
oprypin has joined #crystal-lang
<crystal-gh>
[crystal] asterite opened pull request #6410: HTTP::Client: set `connection: close` header on one-shot requests (master...bug/6401-missing-connection-close-header) https://git.io/fNcSW
<FromGitter>
<wontruefree> crystal master is not running specs on master on OSX for me
<FromGitter>
<wontruefree> is anyone else seeing seeing and problems ?
<FromGitter>
<wontruefree> file spec is failing
olbat[m] has joined #crystal-lang
<crystal-gh>
[crystal] asterite opened pull request #6411: Compiler: give error if constant has NoReturn type (master...bug/6139-const-no-return) https://git.io/fNc9D
<crystal-gh>
[crystal] asterite opened pull request #6413: Parser: fix parsing of named tuple inside generic type (master...bug/6014-parse-named-tuple-inside-paren) https://git.io/fNcQP
<crystal-gh>
[crystal] asterite opened pull request #6414: Compiler: evaluate instance var initializers at the metaclass level (master...bug/5876-instance-var-initializer) https://git.io/fNc5p
kixune[m] has joined #crystal-lang
akaiiro[m] has joined #crystal-lang
edwardloveall[m] has joined #crystal-lang
<FromGitter>
<wontruefree> @icyleaf yep
<FromGitter>
<icyleaf> Me, too, i guess it is problem in block code in flag? macro.
akaiiro has quit [Ping timeout: 244 seconds]
<renzhi>
is there a specific reason that an 8MB stack is allocated for each fiber? Could a smaller stack do the work?
akaiiro has joined #crystal-lang
<FromGitter>
<bew> Iirc it's 4KB for each fiber (1 page), and it can expand to 8MB
<renzhi>
but the Fiber.allocate_stack method seems to call mmap with 8MB size though
<renzhi>
I'm just trying to understand what it does internally :)
baweaver is now known as baweaver_away
baweaver_away is now known as baweaver
<FromGitter>
<bew> I guess it's 8MB of virtual memory, then the kernel does its thing to really allocate as few pages as possible: only 1 page for a new fiber (a page is usually 4KB)
<FromGitter>
<aisrael> How should we handle when a shard that we use has a macro that reads from a file?
<FromGitter>
<aisrael> In the dependent project, when I try to compile it complains that it can't read the file :(
<FromGitter>
<aisrael> E.g. in my `cql` shard, I have a macro that reads a file (that contains irregular singular to plural inflections) `$CQL/etc/irregular.txt`.
<FromGitter>
<aisrael> Now I want to use my `cql` shard, but in `project` the compiler complains that it can't find `$PROJECT/etc/irregular.txt`
<FromGitter>
<straight-shoota> The macro should probably use a path relative to the file it is defined in.
<FromGitter>
<aisrael> Thanks, will try
<FromGitter>
<aisrael> (So, yeah, am thinking a way to package and distribute shards as a "binary" might be useful...)
<FromGitter>
<aisrael> It didn't work :( I changed `File.open("etc/irregular.txt")` to `File.open("./etc/irregular.txt")`. While the `cql` specs still passed, the `project` still wouldn't compile
<FromGitter>
<aisrael> In the mean time I'll just "hard code" the macro expansion (all 3000 lines) into my `.cr` file :(
<FromGitter>
<straight-shoota> `etc/irregular.txt` and `./etc/irregular.txt` are actually identical paths and relative to the current working directory, so obviously that won't work when run from a different directory
<FromGitter>
<straight-shoota> But `File.open` executes at runtime, so what does this have to do with a macro?
alex`` has joined #crystal-lang
<FromGitter>
<aisrael> The macro uses `run('../etc/read_as_hash')`. `$CQL/etc/read_as_hash.cr` is what has the actual `File.open('./etc/irregular.txt')`
<hightower4>
Is there a way to serialize and deserialize a tuple?
<FromGitter>
<straight-shoota> Okay, so `File.open` is runtime executed in a macro.
<hightower4>
I am using msgpack and if I serialize an object with a tuple, on deserialization it gives me: instance variable '@x' of MyClass must be Tuple(String, String), not MessagePack::Unpacker
<FromGitter>
<straight-shoota> Then you just have to replace `"./etc/irregular.txt"` with `File.join(__DIR__, "irregular.txt")`. This will resolve the file name in the same directory as `read_as_hash.cr`.
<FromGitter>
<straight-shoota> where do you live? :D
<FromGitter>
<straight-shoota> hightower4, I don't know how the shard is implemented exactly
<hightower4>
I'm gonna checks spec/ files for ideas
<FromGitter>
<aisrael> @straight-shoota Manila, where beer can be had for $0.50 a bottle :D
<FromGitter>
<straight-shoota> All right xD will give you a heads up when I'm around
<FromGitter>
<aisrael> ๐
<hightower4>
straight-shoota: solved my msgpack issue. I had type defined as @x : Tuple(String,String) and later def initialize(@x). But it looks like msgpack uses macros and it needed an explicit def initialize( @x : Tuple(String,String))
<FromGitter>
<drum445> how do i find out what types are in my array?
<hightower4>
drum445: typeof(your_arr) ?
<FromGitter>
<drum445> gives me: Array(Person):Class โ I want it to just give me Person if possible please
<FromGitter>
<drum445> So what types my array contains
<FromGitter>
<r00ster91> I think you can just do something like `puts typeof([1, ""]).to_s[6..-2] # => Int32 | String` then
<FromGitter>
<drum445> That works @r00ster91 but I need the object as I want to do Person.new
<hightower4>
drum445: you can't do that
<hightower4>
(well, at least not without using macros)
<FromGitter>
<aisrael> @drum445 I'm trying to understand your use caseโare you writing some sort of library where you're expecting an arbitrary `Array(T)` and want to get `T.class`?
<FromGitter>
<drum445> yep exactly that, it's my micro-orm: https://github.com/drum445/objectify โ I want to be able to do Array(Person).from_rs(rs)
<hightower4>
timbus: actually that works, nice one
<FromGitter>
<drum445> it works great for โ Person.from_rs(rs) โ But i am falling into issues with arrays
<FromGitter>
<aisrael> How about `Array.from_rs(Person, rs)`?
<FromGitter>
<aisrael> (What I did instead is something like `CQL.connect.schema(Person, "persons", name: String).select.all # => Array(Person)`)
<FromGitter>
<drum445> I had that first one already, some feedback suggested from_rs would be nice
<FromGitter>
<drum445> got it working now though, thanks all
<FromGitter>
<straight-shoota> @drum445 If It is used in a static method in `Array`, you can just use `T`: โ โ ```def Array.from_rs(rs) : self โ new_array = new โ return Objectifity.to_many(rs, T)``` [https://gitter.im/crystal-lang/crystal?at=5b51b3a8b2411177a25cc431]
<FromGitter>
<straight-shoota> No need for typeof or initializing an instance
<FromGitter>
<drum445> That function doesn't know what T is
<FromGitter>
<drum445> Will see if I can make your suggestion work though, as it is a little cleaner
<FromGitter>
<straight-shoota> oh, maybe you have to use `def Array(T).from_rs ...`
<FromGitter>
<straight-shoota> or wrap it in `class Array(T); def self.from_rs(rs) ...`
<FromGitter>
<j8r> hum yes sorry the problem is puts
<FromGitter>
<j8r> `puts` returns no value, it prints to stdout
<FromGitter>
<j8r> it can be that
<crystal-gh>
[crystal] asterite opened pull request #6418: Give proper error when doing sizeof uninstantiated generic type (master...bug/6415-sizeof-uninstantiated-generic) https://git.io/fNCPi
<wontruefree>
since specs are not passing on peoples macs
rohitpaulk has quit [Ping timeout: 244 seconds]
<FromGitter>
<straight-shoota> cheers, RX14
<RX14>
it was quite some work
<RX14>
learned a lot about llvm
<FromGitter>
<straight-shoota> I can imagine
<RX14>
well i'm pretty glad I worked it out
<RX14>
there was a while in the middle where I nearly gave up
<FromGitter>
<straight-shoota> understandable^^
<RX14>
I was missing one pointerof() call
alex`` has joined #crystal-lang
<RX14>
lol
<FromGitter>
<straight-shoota> ouch
DTZUZO has quit [Ping timeout: 240 seconds]
<wontruefree>
I am curious what you learned I have been trying to get more into the llvm work on crystal but I really dont know where to get started
<FromGitter>
<straight-shoota> it's always amazing how simple a solution can be after you have been wrapping your head around it for hours ^^
<FromGitter>
<straight-shoota> but I suppose exceptions is probably the biggest obstacle before getting somewhat decent windows support, so hell yeah, that's awesome
<RX14>
its insanely hard to debug whats going on on windows
<RX14>
because debug symbols are flat-out broken
<RX14>
you don't even get symbols
<RX14>
all my stacktrace in visual studio was __crystal_main+0xlargenumber
<FromGitter>
<j8r> ๐ฎ
<RX14>
@straight-shoota want to see if you can break my code?
<Yxhuvud>
heh, that reminds me of a course (based on SICP) where I spent a full day trying to find a place where my collaborant had failed to place a `car`
<FromGitter>
<straight-shoota> haha, is so, it's probably just by pure luck
wontruefree has quit [Quit: bye]
<FromGitter>
<straight-shoota> I know near nothing about codegen and LLVM
<RX14>
sure
<FromGitter>
<straight-shoota> but I'll take a look ๐
<RX14>
I was more wondering if you had any large pieces of code to throw at it
<RX14>
such as some windows PR I didnt know about
<FromGitter>
<straight-shoota> yeah, registry ^^
<FromGitter>
<straight-shoota> I've taken a look at sockets, but it needs fibers first. And I can't do fibers ๐
<RX14>
fibers shouldnt be hard
<RX14>
well actually
<RX14>
the calling convention is different
<RX14>
so yeah
<RX14>
lol just annotate the fiber switch with the gnu calling convention
<RX14>
problem solved
<FromGitter>
<straight-shoota> :D
wontruefree has joined #crystal-lang
<RX14>
no seriously
<RX14>
i'm serious
<FromGitter>
<straight-shoota> fine by me
<RX14>
i had a look at stacktraces too
<RX14>
in windows they seem... not that bad
<RX14>
(famous last worlds)
akaiiro has quit [Ping timeout: 248 seconds]
<RX14>
but without the debugging info actually working even in visual studio thats fairly useless
<crystal-gh>
[crystal] RX14 opened pull request #6419: Support exception handling on windows (master...feature/windows-exceptions) https://git.io/fNCjQ
<FromGitter>
<hugoabonizio> when will we have a Crystal Hero Awardโข to give one to @RX14? ๐
akaiiro has joined #crystal-lang
<FromGitter>
<sdogruyol> Soon :)
<FromGitter>
<bararchy> RX14 what's your next quest in the Windows realm? :)
<FromGitter>
<bararchy> Fibers ?
<RX14>
getting all the stuff I have in my branch upstreamed
<RX14>
lol
<FromGitter>
<bararchy> hahaha
<FromGitter>
<bararchy> makes sense
<RX14>
next quest is getting a compiler working
<RX14>
bootstrapping is key
<RX14>
and the compiler doesn't *need* fibers
<FromGitter>
<bararchy> yeha having a `crystal.exe` compiler can help many people start working with and testing the compiler on windows
<FromGitter>
<bararchy> also taking care of the STDlib
<FromGitter>
<straight-shoota> exceptions is already a huge win to work on stdlib
<FromGitter>
<bararchy> it is
<FromGitter>
<straight-shoota> with out it, you can't really spec many edge cases... :D
Groogy has joined #crystal-lang
<FromGitter>
<Daniel-Worrall> so what's the coverage of the exceptions now? What will we be seeing?
kixune[m] has quit [Ping timeout: 240 seconds]
akaiiro[m] has quit [Ping timeout: 255 seconds]
Frank[m] has quit [Ping timeout: 260 seconds]
Renich[m] has quit [Ping timeout: 240 seconds]
Connor[m]1 has quit [Ping timeout: 255 seconds]
Connor[m] has quit [Ping timeout: 255 seconds]
braidn[m] has quit [Ping timeout: 240 seconds]
kp666[m] has quit [Ping timeout: 245 seconds]
olbat[m] has quit [Ping timeout: 256 seconds]
edwardloveall[m] has quit [Ping timeout: 276 seconds]
duane has quit [Ping timeout: 276 seconds]
wontruefree has quit [Quit: bye]
wontruefree has joined #crystal-lang
akaiiro has quit [Ping timeout: 240 seconds]
olbat[m] has joined #crystal-lang
<FromGitter>
<Daniel-Worrall> Some code snippets and results would be really great
wontruefree has quit [Quit: bye]
<FromGitter>
<jspillers> hey guys, i am doing some web socket-y redis pub/sub-y stuff and getting a weird error that causes the process to die and print this: โ โ ```gmp: overflow in mpz type โ Program received and didn't handle signal IOT (6)``` โ โ anyone seen anything like this before? google yields very little in the way of clues... [https://gitter.im/crystal-lang/crystal?at=5b526055ee530e4aac89269c]
<FromGitter>
<soanvig> Don't you think, that Crystal docs are really hard to use and search through?
<FromGitter>
<soanvig> And I don't mean documentation itself, but the rendered page
<FromGitter>
<Daniel-Worrall> What's difficult about it?
<FromGitter>
<soanvig> @Daniel-Worrall the worst thing - any click in long menu on left returns to the top, that awful. Search results are really weird sometimes
<FromGitter>
<soanvig> And it's ugly imho. That purple!
<FromGitter>
<soanvig> The main screen is nice though
<FromGitter>
<soanvig> But it lacks Table of Contents
<FromGitter>
<straight-shoota> @soanvig Yeah, there is much room for improvement. We need a proper concept for the API docs, and there are a lot of open design questions like extracting the HTML rendering from the compiler.
<FromGitter>
<straight-shoota> But there are currently more important issues I think.
<FromGitter>
<soanvig> @straight-shoota is there docs generator source code somewhere? I can take a look at it
<FromGitter>
<straight-shoota> it's in `src/compiler/crystal/tools/doc`
Excureo has quit [Remote host closed the connection]
<FromGitter>
<soanvig> ty
<FromGitter>
<straight-shoota> the jumping viewport in the menu should probably be easy to fix
<FromGitter>
<straight-shoota> it actually worked before the latest release, but it seems it got screwed up with #5229
<FromGitter>
<soanvig> I'm actually making a fork. I have two tweak in mind: the first thing is jumping viewport, the second: match Crystal to https://crystal-lang.org/media/
<FromGitter>
<straight-shoota> and yeah, the search results are a bit weird sometimes
<FromGitter>
<soanvig> This is harder to debug I think :P
<FromGitter>
<straight-shoota> but better than anything before, and it mostly works ๐
<FromGitter>
<straight-shoota> fixing the jumping viewport is a good thing
<FromGitter>
<straight-shoota> But matching Crystal CI is a more complicated topic
<FromGitter>
<straight-shoota> I'd hold off on that. There's a lot involved in this and needs proper discussion and planning. And most importantly, decisions. Decision making is probably the most difficult part.
<FromGitter>
<straight-shoota> You can take a look at #4755
<FromGitter>
<straight-shoota> Or, if it's just JavaScript, you don't need to build the compiler
<FromGitter>
<straight-shoota> Just generate docs and insert the new JS code at the appropriate location
<FromGitter>
<soanvig> Second option makes sense!
<FromGitter>
<straight-shoota> Actually, I mostly edit JS directly in the generated docs folder and when everything works, then backport it to the compiler templates
<crystal-gh>
[crystal] soanvig opened pull request #6420: Fix docs navigator not scrolling into selected element on page load (master...fix/docs-jumping-viewport) https://git.io/fNWsg
<FromGitter>
<Blacksmoke16> omg your're a saint
<FromGitter>
<Blacksmoke16> wouldnt work on safari or IE tho :/
<FromGitter>
<soanvig> This is the worst thing during learning Crystal x.x
<FromGitter>
<soanvig> @straight-shoota what was your convention for that JS/CSS code? It doesn't follow best practices, and I would like know, if there was any reason for that?
<crystal-gh>
[crystal] ysbaddaden pushed 2 new commits to master: https://git.io/fNWsd