rohitpaulk has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
<FromGitter>
<bararchy> oprypin I'm playing around with your dbus bindings
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
ShalokShalom has quit [Remote host closed the connection]
alex`` has joined #crystal-lang
alex`` is now known as alexherbo2
alexherbo2 is now known as alex``
<jokke>
coming back to my zeromq threading problem: i gather from the docs, that the function i'm using will always be run in the current thread and will be blocking until the whole context is terminated: http://api.zeromq.org/2-1:zmq-device
<jokke>
what are my options?
<FromGitter>
<bew> what method are you using which block the thread?
<Papierkorb_>
We already told you that implementing zmq is not only doable (simple protocol), but also the correct way to go about it if libzmq can't be integrated with libevent
<FromGitter>
<bararchy> does someone has some experiance with gdbus?
<jokke>
Papierkorb_: lol i'm not going to implement zmq
<Papierkorb_>
Even when Crystal gains real threading, that solution will still block a whole thread
<Papierkorb_>
It will *always be crap*
<Papierkorb_>
Then integrate it with libevent. if it can't, then open an issue on their end.
<Papierkorb_>
Even with threading, it will look like it works, but what actually happens is that you drastically degrade the performance of the whole application.
<jokke>
how come?
<Papierkorb_>
Scheduler et al.
<Papierkorb_>
What I write won't change things anyway.
<FromGitter>
<bararchy> Groogy that was a WTF moment in wikipedia right now
<FromGitter>
<bararchy> hahaha
<Groogy>
"ou can run a program without compiling it, simply by using an #include statement from the command line. The program is then brought into the shell's current namespace, and from there you can execute individual functions directly just by issuing commands."
<Groogy>
wtf?
<Groogy>
that is super weird, scary and cool at the same time
<Papierkorb_>
It's just a different paradigm
<Groogy>
"It uses a non-standard text format which has support for hypertext links, images and 3D meshes to be embedded into what are otherwise regular ASCII files. A file can have, for example, a spinning 3D model of a tank as a comment in source code."
rohitpaulk has joined #crystal-lang
hightower2 has joined #crystal-lang
<Papierkorb_>
Isn't that actually an interesting feature for a game dev?
<Papierkorb_>
you're writing a physics simulation and can put a sample animation on top of it as 'comment'?
rohitpaulk has quit [Ping timeout: 240 seconds]
hightower3 has quit [Ping timeout: 268 seconds]
<Papierkorb_>
It is different, but that's mainly cause we assume that our source files are pure plain-text. That they are is an implementation detail.
DTZUZO has quit [Read error: No route to host]
<Groogy>
Yes I wsn't dissing it
<Groogy>
I thought it was cool
<Groogy>
I can also imagine all the 90's gif make a comeback in source comments
<Groogy>
like there's some code with a comment "no idea why but have to do it like this or else it crashes" foillowed by this
<jokke>
well you will have to add a socket for that
<jokke>
sure zmq is very simple but i find that one of the major benefits of zmw
<jokke>
zmq
<RX14>
sure
<jokke>
if you only need a small subset of the features of a "fully featured" message queue, it's great
<RX14>
so it's a bad message queue and it has loads of functions that isn't a message queue
<RX14>
it's not a message queue
<RX14>
its a bad name
<jokke>
well they could call it libmq :D
<jokke>
that's basically what it is. a library for building message queues
<RX14>
it's a library for communication in general
<RX14>
it's much more general and powerful than just message queues
justicefries has joined #crystal-lang
<jokke>
yeah that's true
snsei has joined #crystal-lang
snsei has quit [Client Quit]
<jokke>
anyhoo now i fork the zmq proxies :P
<jokke>
works like a charm :P
snsei has joined #crystal-lang
<RX14>
ouch
rohitpaulk has quit [Ping timeout: 240 seconds]
<jokke>
hehe
<jokke>
it's fine. the only thing the program does is just that: proxying zmq message
<jokke>
s
<jokke>
basically a little "broker" just so it can run on well known addresses so that clients can just connect to it instead of having to know whether they have to bind or to connect.
<FromGitter>
<bew> finally!!! the build passes for #4056 :D
<faustinoaq>
Somebody knows how we can make crystal faster on Data updates and multiples queries? @marksiemers @drujensen RX14? 🙂
<RX14>
benchmark it
<RX14>
dont do anything without benchmarking
<faustinoaq>
👍 Do You mean ruby db drivers vs crystal db drivers?
DTZUZO has quit [Read error: Connection reset by peer]
<RX14>
i meant profile actually
DTZUZU has quit [Read error: Connection reset by peer]
<RX14>
look at what's taking up the time
DTZUZO has joined #crystal-lang
DTZUZU has joined #crystal-lang
<faustinoaq>
Oh, I understand, using something like instruments or valgrind 👍
claudiuinberlin has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
faustinoaq has quit [Read error: Connection reset by peer]
Creatornator has joined #crystal-lang
faustinoaq has joined #crystal-lang
justicefries has joined #crystal-lang
watzon_ has joined #crystal-lang
faustinoaq has quit [Quit: IRC client terminated!]
<FromGitter>
<johnjansen> anyone know if you can lock the T of a subclass of a Generic class ⏎ ⏎ ```class Dictionary < Set ⏎ end``` ⏎ ⏎ where Dictionary will only contain strings, but is essentially a Set on steroids [https://gitter.im/crystal-lang/crystal?at=5a1dc1c9540c78242d5d0f83]
<FromGitter>
<bew> not sure it's a good idea to subclass standards containers though (no argument, it's sth I've heard)
<FromGitter>
<johnjansen> yeah, im not sure either … seems this is close but no cigar anyway `can't extend non-abstract struct Set(String)`
<FromGitter>
<bew> ah then you can't subclass Set, because it's a struct, you should play with composition here not inheritance
<FromGitter>
<johnjansen> yeah, dont think that will work either, but thats ok … just an experimental approach
<Papierkorb>
bew, the issue by itself isn't that you're inheriting from a std class. The thing is OOP-y: A sub-class should augment and/or extend existing logic of the base-class. More often than not, that's not your actual intent when inheriting from a std class
<FromGitter>
<johnjansen> this time it is … add a max_word_length to a set of only strings and some other dictionary stuff ;-)
<FromGitter>
<bew> Better explanation here ^ :) thanks Papierkorb
<FromGitter>
<johnjansen> of course there are 1000 ways to achieve this … just thought id have a hack at this one and see how it felt
<Papierkorb>
johnjansen, I'm not sure on the name "Dictionary", but if you thought about it it's fine! Though if Set is a struct, then your 'class' has to be a struct too.
<FromGitter>
<johnjansen> it didnt work even as `Struct Dictionary < Set(String)` … `can't extend non-abstract struct Set(String)`
<Papierkorb>
Ah now I see. Yeah you can't inherit from a non-abstract struct, which Set is
<Papierkorb>
You can easily build a Set-y thing from a Array or Hash yourself. Or you build a delegator class (I think the fancy name was Decorator Pattern)
<FromGitter>
<johnjansen> ;-) … its a nice idea, seeing as my Dictionary needs most of Set and wouldnt be wrong with all of it
<FromGitter>
<johnjansen> and yes Dictionary is a little ambiguous ;-)
<Yxhuvud>
bew: then there are some standard classes, like String, that you really can't inherit from.
<oprypin>
why is set a struct lol
<Yxhuvud>
My guess? no reason to make it an object - it will contain a pointer to the underlying hash (which in turn is an object).
<Papierkorb>
it's probably a wrapper around Hash? So an optimization?
<FromGitter>
<johnjansen> internally it uses a `Hash` and essentially just uses the keys
<Papierkorb>
I mean it's not expected, but that you don't even notice it until you want to do something kinda unusual, shows that it's viable
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh>
[crystal] RX14 opened pull request #5333: Move File and IO::FileDescriptor's platform-specific parts to Crystal::System (master...feature/io-crystal-system-2) https://git.io/vbU7t