ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
<hightower2> Hey Papierkorb I just got an idea how I'm going to support calling <parent>.new_listener.emit( <signal>.name) when a signal is installed in Cute
<hightower2> I am going to simply open the Cute::Signal class and add the property :parent
<hightower2> Then in the parent class, when I list all its signals in an array anyway, I'll just go over those signals and set their #parent=
<hightower2> This will be just fine and won't require me to modify the 'macro signal' or anything inside Cute
<hightower2> Yet the signals will know their parent, and inside on() they will be able to do super; parent.new_listener.emit....
sz0 has quit [Quit: Connection closed for inactivity]
Philpax_ has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
snsei_ has quit [Remote host closed the connection]
w-p has quit [Ping timeout: 240 seconds]
w-p has joined #crystal-lang
snsei has joined #crystal-lang
balduin has quit [Remote host closed the connection]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
sp4rrow has quit [Quit: Textual]
snsei has quit [Remote host closed the connection]
<jokke> h
<jokke> Whops
mark_66 has joined #crystal-lang
<FromGitter> <bew> `` `test` ``
<FromGitter> <bew> cool, just discovered that one can (inline) code blocks having `` ` `` :)
<FromGitter> <sevk> ` [1,2] - [1] `
A124 has quit [Ping timeout: 240 seconds]
romain1189 has joined #crystal-lang
romain1189 has quit [Client Quit]
romain1189 has joined #crystal-lang
sz0 has joined #crystal-lang
bmcginty has quit [Ping timeout: 240 seconds]
bmcginty has joined #crystal-lang
romain1189 has quit [Quit: romain1189]
hightower3 has joined #crystal-lang
<FromGitter> <krypton97> how can I convert IO type to String?
<FromGitter> <bew> you can read from the IO
<FromGitter> <krypton97> Yeah, that's good too
<FromGitter> <krypton97> How can I/
<FromGitter> <krypton97> ?
<FromGitter> <krypton97> I tried with a slice but gave me an error
<FromGitter> <krypton97> I'm mainly looking to read the request body of a form
<FromGitter> <bew> you're probably looking for `IO#gets_to_end` to read the whole IO to a String
<FromGitter> <bararchy> What kind of sort does Array#sort uses ?
<Yxhuvud> bararchy: I can recommend diving into the source for that kind of questions. The source is quite readable.
<FromGitter> <bew> iirc it's a really fast sorting algorithm, faster than the one in C++ stdlib
<FromGitter> <bararchy> Ok, it seems to use quick sort
<FromGitter> <bararchy> Oh, also heap sort
<FromGitter> <bew> here is the pr: https://github.com/crystal-lang/crystal/pull/3514
<FromGitter> <bew> it's intro sort, never heard of it though..
<FromGitter> <bararchy> Cool
<FromGitter> <bararchy> I'll read on it on wikipedia sounds interesting
<FromGitter> <krypton97> Finally I got it. I was using ctx.reques.body instead of ctx.params.body with kemal
<FromGitter> <Qwerp-Derp> How do I use libui.cr?
<FromGitter> <Qwerp-Derp> I want to run the samples, but I have no idea how :(
<FromGitter> <krypton97> Is crystal regexp fast?
<bmcginty> krypton97: fast enough for the bits I've used it for.
<bmcginty> krypton97: if you want to check for yourself, try using the benchmark module.
<RX14> @krypton97 it uses libpcre which is very optimised
<FromGitter> <krypton97> I'm looking to do some validation
<FromGitter> <Qwerp-Derp> Argh C is confusing :(
<Yxhuvud> rx14: But libPCRE is not statically linked, is it? Because if not, then the minimal cost is the cost for walking the linking, which is not necessarily insignificant.
<RX14> wat?
<RX14> it's linked once when you start the program
<RX14> then it makes no difference
<RX14> disregarding LTO
<FromGitter> <Qwerp-Derp> Argh how do you build GTK+ w/ Homebrew
<Yxhuvud> sure but calling functions in it DO make a difference as it is always a jump or two away.
<RX14> no
<RX14> it's just a normal function call
<bmcginty> I'm blanking out on something here. I've got a pointer of data being returned from a library (libpq). Somehow, when the gc is running, it's segfaulting. I have a suspition it's trying to collect something from libpq land that libpq has already handled. Anyone seen anything like this before or have suggestions on where to go from here?
<bmcginty> fault is in gc_clear_stack_inner, for what that's worth. I've also taken the pointer, created a second pointer, and copied everything over with `Pointer.malloc(original_pointer_size) { |i| original_pointer[i] }`. so the original pointer shouldn't be used outside of that one area in the program...
<FromGitter> <Qwerp-Derp> Does anyone know where to start with making a C binding for GTK+?
<FromGitter> <Qwerp-Derp> It honestly seems like a monumental task
<FromGitter> <Qwerp-Derp> Because I have basically 0 knowledge of C
<Papierkorb> Beginning with Gtk in that case doesn't sound like a good idea tbh
<Papierkorb> The issue isn't even writing the pure binding itself. The issue is first getting structures right, and then the correct integration
<Papierkorb> In terms of Gtk, you also have to deal with GObject, and suddenly you have inheritance in C you have to wrap too.
<RX14> i havent used gobject but it sounds like a terrible idea
w-p has quit [Ping timeout: 255 seconds]
<FromGitter> <sdogruyol> hey everyone
<FromGitter> <bew> hey @sdogruyol ;)
<FromGitter> <sdogruyol> hey @bew, how are you?
<FromGitter> <bew> good! it seems to be a long time, did you take some vacation?
<FromGitter> <sdogruyol> yeah, I've just returned from a vacation
alibby has quit [Quit: Leaving.]
<FromGitter> <bew> good! So you're ready to return in your crystal ambassador role? ;)
<FromGitter> <sdogruyol> I'll do my best πŸ‘
w-p has joined #crystal-lang
<bmcginty> I goofed. not a gc issue (again, when will I learn). I was recursively calling a function.
<RX14> bmcginty, easy way to tell is stackoverflow has "(n times)" in one of the backtraces
snsei has joined #crystal-lang
<FromGitter> <krypton97> I find crystal so much more productive than go. Kinda reminds me about node.js but simpler hehe
<FromGitter> <krypton97> And no async stuffs hehe
<FromGitter> <LuckyChicken91_twitter> yes crystal is really awesome
snsei has quit [Remote host closed the connection]
alibby has joined #crystal-lang
<FromGitter> <sdogruyol> @krypton97 indeed πŸ’―
snsei has joined #crystal-lang
<FromGitter> <krypton97> wondering id there's something similar with try/catch block in crystal o.O
<FromGitter> <bew> yep: begin/rescure/ensure (doc: https://crystal-lang.org/docs/syntax_and_semantics/exception_handling.html)
<FromGitter> <krypton97> Yeah, I've found that
<FromGitter> <krypton97> gonna play with it
<FromGitter> <krypton97> rn
rumenzu has joined #crystal-lang
rumenzu has quit [Client Quit]
Ven has joined #crystal-lang
Ven is now known as Guest12884
<FromGitter> <krypton97> begin/rescue/else works like a charm
<FromGitter> <krypton97> Well done crystal team. No more err != nil bs..
<FromGitter> <sdogruyol> Oh, what do you mean?
<FromGitter> <krypton97> err != nil is specific to Golang. Go libraries are written that way so they always return an error (nil or something else)
<FromGitter> <sdogruyol> Ahh, now i get it
<FromGitter> <sdogruyol> I don't like that kind of error handling
<FromGitter> <krypton97> It's a pain..doing assertion for every function it's not productive at all
Guest12884 is now known as Ven``
<FromGitter> <cevarief> Hi, i'm new to crystal any crud sample with sqlite or any rdbms ?
<FromGitter> <krypton97> It has some nice samples
<FromGitter> <cevarief> @krypton97 Thank you.
<FromGitter> <krypton97> If you need any help I'm here. Currently working with sqlite as well
z64 has quit [Quit: WeeChat 1.8]
<crystal-gh> [crystal] RX14 closed pull request #4805: Context: show more helpful message for never called method (master...fix/crystal-context/detailed-message-for-nerver-called-method) https://git.io/v7KII
snsei has quit [Remote host closed the connection]
<jokke> hey
<FromGitter> <sdogruyol> hey @jokke
<jokke> if i were to develop an alternative stdlib, how would i provide a prelude file for it?
<jokke> i tried putting a file "prelude.cr" in src/<project_name>/
<jokke> and then compiling something with --prelude prelude
<FromGitter> <sdogruyol> can't you do that with --prelude ?
<jokke> but that just seems to include the standard prelude
<jokke> at least it let me use puts, which isn't in my stdlib
<FromGitter> <bew> you need `--prelude "./prelude"`
<jokke> bew: and what if i want to build another project which uses my stdlib as a dep?
<FromGitter> <bew> it uses the same "path" logic than `require` iirc
<jokke> bew: ah i see
<jokke> okay, so then it would be <my_lib>/prelude
<jokke> thanks :)
<FromGitter> <bew> yes shoudl be ;)
<jokke> are there any gc libs in crystal in the works?
<FromGitter> <sdogruyol> nope
<jokke> dang
<FromGitter> <sdogruyol> I'm not aware of any GC written in Crystal
<FromGitter> <sdogruyol> we need one though but not now :P
<jokke> :)
<jokke> i was pretty impressed when i found out that go has zero C deps
<FromGitter> <sdogruyol> writing a GC is tough, not the GC itself though :D
<FromGitter> <sdogruyol> yeah, they've written everything in Go but that took like 3-4 years
<jokke> yeah
<jokke> even the cryptostuff
<jokke> but i hate go :D
<jokke> i think it's a terrible language
<FromGitter> <sdogruyol> heck, they even have image manipulation in go
<Papierkorb> jokke: My pure crystal GC can't scan the stack yet, so not useful. Had to hack the stdlib a bit though
<jokke> Papierkorb: oh wow!
<Papierkorb> jokke: It's currently not meant to be used outside the boehm-gc lul
<FromGitter> <sdogruyol> @Papierkorb open source it please πŸ™
<FromGitter> <sdogruyol> what do you use for alloc?
<Papierkorb> sdogruyol, when I get to it (*cough* Qt), and get it to scan stuff like Boehm, it might actually do something useful
<Papierkorb> Simply LibC.malloc() atm. Didn't see a need to switch that out,
<Papierkorb> Not to mention that memory allocation is a beast of its own
<FromGitter> <sdogruyol> yeah...
<jokke> yeah :/
<FromGitter> <krypton97> Is it possible to remove an value from a named tuple? Couldn't find anything in the docs so I guess no
<Papierkorb> Though, that'd just be a re-definition of __crystal_malloc(). And if you remember, I do have a stupid and naive memory allocator in Crystal, though that one was meant to be used in a kernel, so it's doing no mmap() stuff as of now
<Papierkorb> krypton97, no. If you need a mutable structure, don't use an immutable-by-definition structure like NamedTuple. Use Hash instead.
<FromGitter> <krypton97> I was aware of that
<FromGitter> <krypton97> thanks
<Papierkorb> sdogruyol, right now hacking away on Qt bindings. @GC, it needs small-ish changes to the stdlib. When I get to it, I'd preface it with a compiler PR. My local source copy of crystal uses the GC - It does work, it just never free's objects ;)
<watzon> Papierkorb: are those bindings on Github yet?
<watzon> I'm getting my Hackintosh set up again so I can start working in Crystal again without WSL's limitations
mark_66 has quit [Remote host closed the connection]
<Papierkorb> watzon: Far from it.
<watzon> Oh well πŸ˜…
alibby has quit [Quit: Leaving.]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Papierkorb> Ah man, Crystal doesn't even allow a n Uppercase_function_name in a lib block
<RX14> Papierkorb, it should as a C name
<RX14> like fun foo = "Foo"?
<RX14> i think?
<Papierkorb> That would make the name mangling even worse
<RX14> huh?
<Papierkorb> I added a lowercase prefix
<RX14> you're meant to unmangle the name in the bindings
<Papierkorb> Yeah and then I have to remangle to allow for method overloading.
A124 has joined #crystal-lang
<RX14> what?
<jokke> how did one expose c functions again?
<RX14> what are you trying to do?
<Papierkorb> Binding Qt.
<RX14> C++?
<Papierkorb> A C++ lib.
<RX14> dont
<RX14> write a C wrapper
<Papierkorb> m(
<RX14> jokke, use fun outside lib
<jokke> gobject?
<Papierkorb> That's what it's doing
<RX14> jobject is gtk
<Papierkorb> And then in turn generate the Crystal lib out of that
<Papierkorb> And then in turn generate the classes in Crystal so that stuff is actually usable.
<RX14> jokke, s/def/fun in the top level and use C types in the function definition and it should work
<jokke> yup thanks
<travis-ci> crystal-lang/crystal#ac88068 (master - Context: show more helpful message for never called method (#4805)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/264421339
<jokke> how does a string literal get turned into a string?
<jokke> (i mean an instance of String)
<travis-ci> crystal-lang/crystal#ac88068 (master - Context: show more helpful message for never called method (#4805)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/264421339
<jokke> i mean generally how do literals get turned into their respective classes instances.
<Papierkorb> language feature in theory, the compiler generates the code for it in practice.
<jokke> Papierkorb: yes, i get that. but what exactly does the compiler generate?
<jokke> (i want to write my own string class)
<Papierkorb> No user-defined literals.
<jokke> sure
<jokke> i don't need any
<Papierkorb> The compiler writes the string data into .rodata, and then gives out a String instance which points to that data
<jokke> so i would have to define self.new(UInt8* data)?
<Papierkorb> Well you could, but the compiler won't do the constant-instance stuff for your own type. it'll be generated like normal.
<jokke> Papierkorb: you lost me.. :/
<jokke> if i start writing a bare-metal stdlib i need to define stuff like that...
<Papierkorb> You can write MyString.new("foo"). but will do the constant-string stuff for the literal, and at runtime, eventually call your constructor.
<Papierkorb> no?
<jokke> no?
<jokke> if there's no malloc...
<Papierkorb> That's what I've been telling you: `"foo"` is never malloc()d#
<jokke> yes, that's great! i don't want to malloc it. but i still need to access the pointer
<Papierkorb> `String#to_unsafe`
<jokke> is that in primitives.cr?
<Papierkorb> I don't think so. Just rip it out of string.cr
<Papierkorb> Or was that one special? Don't remember.
<jokke> Papierkorb: but if i don't require "string"
<Papierkorb> Point is, that's not something you have to take much care of. If you want to implement a custom stdlib (in terms of wanting to replace libc), implement it like the current libc's are defined, but implementing them instead of only providing declarations
<jokke> how will that work?
<Papierkorb> Just rip it out and stuff it into your_custom_string.cr?
<Papierkorb> Mind you though, libc will be pulled in again by any kind of C dependencies
<jokke> yeah, that's why i want to start from scratch
<jokke> i just checked string.cr
<Papierkorb> No GC either.
<Papierkorb> And no memory management at all of course.
<jokke> sure
<Papierkorb> Start small. Implement a memory allocator, and overwrite __crystal_malloc and its friends. Implement a binding to the mmap() syscall for that.
<Papierkorb> Then you can go on replacing various other parts of the libc without tearing too much apart.
<jokke> i don't want dynamic memory allocation
<Papierkorb> How do you expect to run crystal programs then?
<Papierkorb> Just writing `[ "foo", "bar" ]` does an allocation. You can have a static pool of memory you allocate out of, but you do need an allocator in any case
<jokke> :/
<Papierkorb> What did you expect? How's the program supposed to manage resources if there's no memory to use?
<jokke> there's a stack :)
<Papierkorb> And now you're stuck with static strings and static array. And integers, fair enough. The end.
<jokke> i hoped i could do without malloc
<jokke> and static structs?
<Papierkorb> everything that calls itself a Value, yes
<jokke> yup
<Papierkorb> Crystal doesn't (even) support VLAs known from C, so you're outta luck there too
<jokke> VLA?
<Papierkorb> variable length arrays - which are stored on the stack
<Papierkorb> What's your target platform?
<jokke> oh
<jokke> Papierkorb: bare metal arm
<Papierkorb> Then you have plenty of memory to use
<jokke> mmh
<jokke> but memory management is a pain
<jokke> :D
<Papierkorb> Even if you're restricting it to a static-sized pool first
<Papierkorb> Yeah, which is why people use operating systems
<jokke> :D
<jokke> true
<jokke> but won't fragmentation be a huge issue?
<Papierkorb> Is it an issue with your computer? With Crystal in particular, or any other C/C++ program you use?
<Papierkorb> If not, then not.
<Papierkorb> Sure, a proper memory allocator tries to keep fragmentation low. But after that, it becomes a theoretic issue used by Java (etc.) people to spread FUD.
linuksz has joined #crystal-lang
<jokke> no i just mean: let's say i implement some kind of malloc which reserves memory from a fixed sized pool. Then at some point a malloced object will be destroyed. This leaves me with a hole in the pool.
<jokke> i'd imagine that happens quite a lot
<Papierkorb> yup
<Papierkorb> ..so?
<jokke> which makes me run out of memory way faster than i should
<jokke> which makes it necessary to implement some kind of defragmentation
<Papierkorb> ... an allocator reuses free memory
<jokke> sure
<jokke> but it would have to be exactly the same size
<jokke> or smaller
<Papierkorb> As your code doesn't change at run-time, the chances for that are quite high
<jokke> hmm
<jokke> yeah maybe i just should implement some naive malloc and see where that get's me
<jokke> *gets
<RX14> jokke, String has a fixed binary representation
<RX14> the compiler writes that binary representation to .rodata at compile-time
<RX14> the instance is pre-instantiated
<RX14> String class always exists with the ivars pre-defined by the compiler
alibby has joined #crystal-lang
<linuksz> how can i access environment variables in Crystal?
alex` has joined #crystal-lang
alex` is now known as Guest29819
Guest29819 is now known as alex``
<jokke> linuksz: ENV["FOO"]
<linuksz> so the program has a hash, that contains the variables and values?
<FromGitter> <drosehn> as far as the programmer is concerned, yes.
w-p has quit [Ping timeout: 240 seconds]
_tsound has joined #crystal-lang
<_tsound> hello all, one more quick question about cross-compilation, does it have any relation to the general LLVM settings
<_tsound> meaning, would it be possible to update crystal's LLVM implimentation in order to obtain certain targets?
<RX14> _tsound, what do you mean?
<RX14> are you asking how easy it is to add a new target?
_tsound has quit [Ping timeout: 240 seconds]
<linuksz> what's wrong with this code?
<linuksz> path_dirs = ENV["PATH"].split(":")
<linuksz> directory = Dir.new(dir) if Dir.exists?(dir)
<linuksz> directory.each do
<linuksz> path_dirs.each do |dir|
<linuksz> puts
<linuksz> end
<linuksz> end
<RX14> if you want it to print anything you havent given an argument to puts
<linuksz> path_dirs = ENV["PATH"].split(":")
<linuksz> directory.each do |entry|
<linuksz> directory = Dir.new(dir) if Dir.exists?(dir)
<linuksz> path_dirs.each do |dir|
<linuksz> end
<linuksz> puts entry
<linuksz> end
<linuksz> this doesn't work
<RX14> well, what's the error
<RX14> "it doesn't work" is pointless
<linuksz> in launcher.cr:5: undefined method 'each' for Nil (compile-time type is (Dir | Nil))
<linuksz> directory.each do |entry|
<linuksz> ^~~~
<RX14> directory can be nil if Dir.exists? is false
<RX14> you should put the whole thing in that if
_tsound has joined #crystal-lang
<linuksz> i corrected the code, and it works. thank you.
<_tsound> RX14: yeah, i want to use llvm-riscv with crystal
<RX14> so thats a fork of llvm which supports riscv
<_tsound> yes
<RX14> if you point it to the correct llvm-config and edit your LD_LIBRARY_PATH crystal can be built using that fork just fine
<RX14> after that you can use for example the ARM port as an example of how to port to a new arch
<RX14> arm is risc-y anyway so it should be a decent example
<_tsound> ah thanks
linuksz has quit [Quit: Leaving.]
<RX14> _tsound, are you planning to run on linux on riscv?
<_tsound> for now, yes
<RX14> ok, so there's a linux port?
<RX14> that'll make it a hell of a lot easier
<RX14> thats really cool
<RX14> i didn't know riscv was so far along
<RX14> i'd be happy to merge a PR with riscv support
_tsound has quit [Quit: WeeChat 1.9]
sz0 has quit [Quit: Connection closed for inactivity]
onionhammer has quit [Ping timeout: 240 seconds]
<RX14> oprypin, is there really no better way to get a randon UInt64 than rand(UInt64::MIN..UInt64::MAX) ?
<oprypin> RX14, how can it be any better
<RX14> being shorter and more obvious
<oprypin> the "syntax" is the most expressive it can be, and the optimization is there as well
<oprypin> what would be more obvious though?
<RX14> next_u8, next_i8, ..., etc.
<oprypin> really
<RX14> yes
<RX14> reall
<RX14> y
<oprypin> i think it's good to do it this way. these cases are rare and it's good to make it clear that you do in fact want this
<oprypin> not to mention avoiding 8 silly aliases of what can already be done
<RX14> i don't think they're silly aliases
<RX14> but perhaps they are less common
<RX14> maybe you're right and it would end up with people abusing next_u64 and modulo.
<oprypin> oh yes
<RX14> ok i think i agree with you
<RX14> i wonder how common it really is though
<oprypin> next_u is still a bit of a danger, is it possible to make an interface with a private method?
<RX14> i'm not sure
<RX14> you can at least make it :nodoc:
<RX14> but you should try it
<oprypin> well the documentation is important, in fact
<RX14> i think :nodoc: should be an includes? check in the doc generator
<RX14> so that you can include "internal" documentation in the source on a method but still be ;nodoc:
<oprypin> I don't understand
<RX14> place :nodoc: anywhere in the docstring and it goes away
<RX14> instead of just the entire doc needs to be :nodoc: exactly as it is right now
<07IAAQDBB> [crystal] RX14 closed pull request #4789: Seed PRNGs from System source instead of time (master...rng_seed) https://git.io/v7Vju
<21WAACDZS> [crystal] RX14 pushed 1 new commit to master: https://git.io/v75Ek
<21WAACDZS> crystal/master d638238 kipar: seed PRNGs from System source instead of time. (#4789)
thelonelyghost has quit [Ping timeout: 246 seconds]
rizo[m] has quit [Ping timeout: 246 seconds]
TheGillies has quit [Ping timeout: 255 seconds]
olbat[m] has quit [Ping timeout: 240 seconds]
Renich[m] has quit [Ping timeout: 255 seconds]
braidn[m] has quit [Ping timeout: 240 seconds]
byteflame has quit [Ping timeout: 246 seconds]
sija[m] has quit [Ping timeout: 264 seconds]
watzon has quit [Ping timeout: 264 seconds]
vegai has quit [Ping timeout: 255 seconds]
hightower2 has quit [Ping timeout: 248 seconds]
jplatte has quit [Ping timeout: 258 seconds]
sz0 has joined #crystal-lang
<travis-ci> crystal-lang/crystal#d638238 (master - seed PRNGs from System source instead of time. (#4789)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/264517965
onionhammer has joined #crystal-lang
onionhammer has quit [Client Quit]
onionhammer has joined #crystal-lang
<FromGitter> <yvendruscolo> hello, has anyone else had trouble compiling on ubuntu? ⏎ ⏎ ```crystal -v ⏎ Crystal 0.23.1 [e2a1389] (2017-07-13) LLVM 3.8.1``` ⏎ ⏎ on my Mac I have llvm 4.0.1 and it works totally fine, but I needed a linux executable [https://gitter.im/crystal-lang/crystal?at=5992179bbc46472974828f47]
<oprypin> yvendruscolo, yes, this seems to be a common problem. is it really not solved yet?
<FromGitter> <yvendruscolo> not on ubuntu. I thought maybe using llvm 4 could solve it, but I haven't figured out how to choose which llvm version to use on ubuntu
<oprypin> yvendruscolo, finally found it https://irclog.whitequark.org/crystal-lang/2017-07-22#19807885;
<oprypin> RX14, hm making the implementations' next_u private seems to work well, except that specs use it directly
<oprypin> i like that in python you can make a method private but still test it, crystal doesnt like that
olbat[m] has joined #crystal-lang
onionhammer has quit [Quit: WeeChat 1.7]
<oprypin> also why is https://github.com/crystal-lang/crystal/pull/4755 ignored? cc RX14
<oprypin> wait, that's just styling
<oprypin> ah yes There is also an enhanced search interface (https://straight-shoota.github.io/crystal/doc-search/) based on this PR and #4746. I'd like to get this or the other merged so I can rebase accordingly and keep a simple commit history.
<oprypin> so it is a big deal
onionhammer has joined #crystal-lang
<oprypin> omg it's beautiful
<travis-ci> crystal-lang/crystal#d638238 (master - seed PRNGs from System source instead of time. (#4789)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/264517965
<travis-ci> crystal-lang/crystal#d638238 (master - seed PRNGs from System source instead of time. (#4789)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/264517965
<FromGitter> <yvendruscolo> @FromIRC now it worked!
<FromGitter> <yvendruscolo> <3
braidn[m] has joined #crystal-lang
byteflame has joined #crystal-lang
vegai has joined #crystal-lang
Renich[m] has joined #crystal-lang
rizo[m] has joined #crystal-lang
jplatte has joined #crystal-lang
thelonelyghost has joined #crystal-lang
TheGillies has joined #crystal-lang
watzon has joined #crystal-lang
sija[m] has joined #crystal-lang
<oprypin> how can I execute an equivalent of `typeof` in compiler code? i was thinking of implementing automatic type annotations in docs
<Papierkorb> https://gist.github.com/Papierkorb/651fab1d02d69a9521ff5a12169b747d Bindings are 100% auto-generated. WIP ~
<oprypin> Papierkorb, awesome
<oprypin> can it do signals tho :|
<Papierkorb> Not yet. Have yet to figure out how to get Clang to tell me about `Q_SIGNALS:` access modifiers (that'll be hacky).
<Papierkorb> I mean it's possible, just hacky.
<oprypin> making your own signals is harder
<oprypin> but oh well, i guess it's not crucial. i've been putting too much focus on that
<Papierkorb> Why do you need that?
<oprypin> hmmm
<Papierkorb> I mean I already have a library which does signal/slots lul.
<oprypin> no but to integrate with the event loop
<oprypin> anyway,... Papierkorb, pls publish this stuff :o
<Papierkorb> Whose name is so similar from its sound, that it may come back biting. Oh the irony.
<Papierkorb> Yeah gotta clean it up. Also, move the binding generator into its own project.
alex`` has quit [Ping timeout: 276 seconds]
<oprypin> Papierkorb, what, do you intend to keep the generated code in a project as well?
<oprypin> or do you want to make a non qt specific binding generator somehow
<Papierkorb> Right now, it's C++/STL capabilities are probably tosh, and C is not possible either, but it somewhat works for C++/Qt which is good enough for me right now lul
<Papierkorb> Ship generated code. Else, every user of that shard needs to have clang installed
<oprypin> Papierkorb, i use a branch for that
<Papierkorb> oprypin: It's right now rather Qt specific, but with time, it can be made more general. It should be a good foundation for that.
<oprypin> Papierkorb, anyway,.. i think you can just publish it now. pleease? don't put in generated code yet, it can be made into a branch later. and making a generic generator should not be on the radar for now
<Papierkorb> No need for a branch. I'll ship all data required to re-generate. If someone wants, they can regen (which will overwrite the existing files), otherwise, use what they already got. They still require a C++ compiler with Qt headers though. Especially for the future Windows crowd it would be neat to ship with prebuilt so/dll, but for now, that's good enough
<Papierkorb> oprypin: No signal support right now, and no event loop integration either. Not really useful like that yet
<oprypin> Papierkorb, do you expect to have commits with generated changes all the time? i don't understand
<Papierkorb> Still have to test if I can also generate the Value types correctly like QImage. Other things like QPainter will require more attention, but *that* one I can do later.
<oprypin> i think the model with the branch works really well. https://github.com/oprypin/crsfml/commits/sources - master branch can be used to edit the code generator, and you keep an orphan branch with generated changes and make releases onto that branch so people can use it from `shards` if you wish to make that possible
<oprypin> anyway. Papierkorb, again, please publish this stuff, this is the kind of project that i must follow from the early days so i know all ins and outs. in case it's not clear, I wish to collaborate.
<Papierkorb> "Just Worksβ„’" is a primary goal. The README could just point it out, or rather, just have the latest generated-branch in its INSTALLATION chapter.
<Papierkorb> oprypin: I will publish it in the near-ish future. Just need to iron out the biggest flaws until it reaches the quality level I expect from my code
<oprypin> pls
<oprypin> Papierkorb, you can force push later to forget the bad code :( I want to see the story unfold before it gets complicated
<FromGitter> <bew> oprypin, you seems very excited to see his code :D
<FromGitter> <bew> @straight-shoota I suggest you change `property` to `value` in your example in your comment https://github.com/crystal-lang/crystal/pull/4772#issuecomment-322267327
hightower2 has joined #crystal-lang
<crystal-gh> [crystal] miketheman opened pull request #4828: Adds Enumerable#reduce? for when input is empty (master...miketheman/empty-reduce) https://git.io/v75yG
hightower2 has quit [Ping timeout: 260 seconds]
_whitelogger_ has joined #crystal-lang
hightower2 has joined #crystal-lang
onionhammer has quit [*.net *.split]
_whitelogger has quit [*.net *.split]
kubaxvx__ has quit [*.net *.split]
justinmcp_ has quit [*.net *.split]
tilpner has quit [*.net *.split]
yopp has quit [*.net *.split]
thews has quit [*.net *.split]
hightower3 has quit [*.net *.split]
Philpax_ has quit [*.net *.split]
go|dfish has quit [*.net *.split]
havenwood has quit [*.net *.split]
foca has quit [*.net *.split]
pleiosaur has quit [*.net *.split]
minus has quit [*.net *.split]
sija[m] has quit [*.net *.split]
bazaar has quit [*.net *.split]
early has quit [*.net *.split]
ephemera_ has quit [*.net *.split]
maxpowa has quit [*.net *.split]
hmans has quit [*.net *.split]
twisterghost has quit [*.net *.split]
jeromegn has quit [*.net *.split]
pabs has quit [*.net *.split]
vifino has quit [*.net *.split]
baweaver has quit [*.net *.split]
daemonwrangler has quit [*.net *.split]
early has joined #crystal-lang
bazaar has joined #crystal-lang
ephemera_ has joined #crystal-lang
rizo[m] has quit [Ping timeout: 240 seconds]
braidn[m] has quit [Ping timeout: 240 seconds]
TheGillies has quit [Ping timeout: 255 seconds]
hmans has joined #crystal-lang
watzon has quit [Ping timeout: 246 seconds]
byteflame has quit [Ping timeout: 246 seconds]
jplatte has quit [Ping timeout: 246 seconds]
foca has joined #crystal-lang
pleiosaur has joined #crystal-lang
havenwood has joined #crystal-lang
minus has joined #crystal-lang
go|dfish has joined #crystal-lang
Philpax_ has joined #crystal-lang
thews has joined #crystal-lang
hightower3 has joined #crystal-lang
Renich[m] has quit [Ping timeout: 255 seconds]
jeromegn has joined #crystal-lang
twisterghost has joined #crystal-lang
thelonelyghost has quit [Ping timeout: 264 seconds]
vegai has quit [Ping timeout: 264 seconds]
go|dfish has quit [Max SendQ exceeded]
justinmcp_ has joined #crystal-lang
kubaxvx__ has joined #crystal-lang
onionhammer has joined #crystal-lang
olbat[m] has quit [Ping timeout: 264 seconds]
yopp has joined #crystal-lang
tilpner has joined #crystal-lang
pabs has joined #crystal-lang
daemonwrangler has joined #crystal-lang
baweaver has joined #crystal-lang
vifino has joined #crystal-lang
go|dfish has joined #crystal-lang
tilpner has quit [*.net *.split]
yopp has quit [*.net *.split]
thews has quit [*.net *.split]
hightower3 has quit [*.net *.split]
Philpax_ has quit [*.net *.split]
havenwood has quit [*.net *.split]
foca has quit [*.net *.split]
pleiosaur has quit [*.net *.split]
minus has quit [*.net *.split]
minus has joined #crystal-lang
pleiosaur has joined #crystal-lang
foca has joined #crystal-lang
havenwood has joined #crystal-lang
thews has joined #crystal-lang
Philpax_ has joined #crystal-lang
hightower3 has joined #crystal-lang