ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.22.0 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
pduncan has joined #crystal-lang
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 260 seconds]
pduncan has quit [Ping timeout: 255 seconds]
Guest81488 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven is now known as Guest89037
Guest89037 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zipR4ND has quit [Ping timeout: 268 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
bjz has joined #crystal-lang
whomp has quit [Quit: Changing server]
whomp has joined #crystal-lang
snsei has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
whomp has quit [Ping timeout: 240 seconds]
snsei has quit [Remote host closed the connection]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
bjz has quit [Client Quit]
bjz has joined #crystal-lang
bjz has quit [Client Quit]
bjz has joined #crystal-lang
bjz has quit [Client Quit]
bjz has joined #crystal-lang
bjz has quit [Client Quit]
Dreamer3 has joined #crystal-lang
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <kureikain> Hi, I have tried to do a simple crystal-lang with mysql server. Querying with `query?` for a single row work. ⏎ ⏎ But when using ⏎ ⏎ ```code paste, see link``` ... [https://gitter.im/crystal-lang/crystal?at=59212d85eec422e415d2be73]
_whitelogger has joined #crystal-lang
<FromGitter> <bararchy> You can see an example in my project
<FromGitter> <bararchy> it uses MySQL
<FromGitter> <elorest> @kureikain Here’s a whole basic web-crud with an ORM and mysql. https://github.com/elorest/amber-crud
<FromGitter> <kureikain> thanks @bararchy @elorest
<FromGitter> <kureikain> let me try them out
<FromGitter> <elorest> On that link I sent there’s a really simple readme so you should be able to get it up and running in about 3 minutes.
<FromGitter> <elorest> I just changed the readme a bit so you might want to reload it.
_whitelogger has joined #crystal-lang
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 240 seconds]
olbat has quit [Ping timeout: 240 seconds]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
zipR4ND has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Papierkorb> why on earth do people use mysql
<Yxhvd> because they were brought up that way
<Yxhvd> (also, traditionally, the replication story was easier there even if pg has improved a LOT in this lately)
<FromGitter> <akzhan> mysql has its own benefits like less pricey connections in the box. https://eng.uber.com/mysql-migration/ ⏎ ⏎ but it’s off topic.
<Papierkorb> "less pricey connections"?
<FromGitter> <akzhan> Cheaper
<Papierkorb> ...aha
bjz has joined #crystal-lang
bjz has quit [Client Quit]
Ven has joined #crystal-lang
Ven is now known as Guest38231
bjz has joined #crystal-lang
TheLemonMan has joined #crystal-lang
whomp has joined #crystal-lang
Guest38231 has quit [Ping timeout: 260 seconds]
whomp has quit [Ping timeout: 268 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Client Quit]
splitty__ has joined #crystal-lang
fedruantine has quit [Read error: Connection reset by peer]
splitty_ has quit [Ping timeout: 260 seconds]
Kug3lis has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
balduin has joined #crystal-lang
balduin has left #crystal-lang [#crystal-lang]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 246 seconds]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 268 seconds]
<FromGitter> <drosehn> I'm hoping to do some crystal-program using LMDB, if I can find the time.
<FromGitter> <bararchy> I want to create a ModBus implementation :)
<FromGitter> <drosehn> I should say "when I find the time", but I just spent the last 36 hours fighting off a DDoS on one of our web servers. That wasn't how I expected to spend this weekend.
<RX14> oh dear
<RX14> i havent been properly DDoSed yet so I don't know what it's like
<FromGitter> <drosehn> This could have been much much worse than it was. There were probably less than a thousand machines in the attack. And of course it started at 5:10pm on Friday, when everyone but me had already left for the weekend. Most (it seems) for vacation-ish events which were far away from Troy.
<FromGitter> <drosehn> At this point they've gotten bored and moved on to annoy someone else.
<FromGitter> <drosehn> This weekend was our commencement, so staff who don't need to be on campus make a point of staying far away.
<FromGitter> <bararchy> That's why you should pay for CloudFlare\Imperva ;)
<RX14> that assumes you're hosting http/https only
<RX14> well cloudflare at least
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 240 seconds]
sz0 has joined #crystal-lang
<FromGitter> <drosehn> That's a decision would is made at a higher management level than mine. But I think I'm going to head back to sleep for awhile. I've had about eight hours of sleep since I woke up on Friday morning, and iirc I didn't get all that much sleep on Thursday night. (although that was due to a line of severe thunderstorms which rolled through our area and took out the power in my house).
<zipR4ND> hey all, how can I make a Proc(T, K).new { |x| .... } recursively call itself ?
<zipR4ND> like how do I get a handle of the Proc inside it's own body?
<RX14> have you tried just `foo : Proc(T,K)` and then referencing it inside the proc
<RX14> actually that wont work
<RX14> >> foo = nil; foo = Proc(T, K).new { |x| # use foo.not_nil! }
<DeBot> RX14: Syntax error in eval:18: expecting token '}', not 'end' - https://carc.in/#/r/2208
<RX14> zipR4ND, thats the best way I think
<Papierkorb> Well you could do lambda calculus...
<zipR4ND> thxx RX14 ..
<zipR4ND> Papierkorb: can you provide an example?
<RX14> zipR4ND, the easiest way is to define a recursive method and take a pointer to it using ->
<zipR4ND> RX14: yea thats also interesting
<RX14> i rarely use procs honestly
Raimondii has joined #crystal-lang
<RX14> at least the literal syntax
<RX14> &block and ->method(Type) make a lot more sense to me
<Papierkorb> I'd actually think about the code architecture, sounds wrong to actually need a recursive proc
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
<FromGitter> <drosehn> yeah, I'm not sure I would even want try to do that unless I was really forced to.
<RX14> recursive methods are fine, so taking a proc to one doesn't sound too bad
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <drosehn> but it seems pretty odd to recurse in a `new` method.
bjz has joined #crystal-lang
<FromGitter> <drosehn> the lambda-calculus video looks interesting, but I need some sleep before I watch the rest of it.
<FromGitter> <bararchy> How would you avoid exsesive memory allocations when in need to read lots of small data packets in a tight loop ? ⏎ ~~~ ⏎ loop do ⏎ mem = Bytes.new(1024) ⏎ size = socket.read(mem) ... [https://gitter.im/crystal-lang/crystal?at=5921a34f2b926f8a6779552a]
<FromGitter> <bararchy> This handler runs for each connecting client where I can have up tp 100K concurrent conncections from clients
<RX14> it's not excessive memory allocation if each slice needs to be used in parallel
<RX14> there's simply no other way
<RX14> you could possibly make your own custom slice allocator but it might not buy you much
<FromGitter> <bararchy> This is what I thought but the GC keeps complaning that this behavior might cause memory leaks etc ...
<RX14> it shouldn't
<RX14> at all
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<RX14> because it's not a large allocation
<FromGitter> <bararchy> Oh, I used bigeer buffer (16k, 32k)
<RX14> do you need a larger buffer?
<RX14> well, do you need a fixed-size buffer?
<FromGitter> <bararchy> Yes
<RX14> you know the exact size before reading?
<FromGitter> <bararchy> Sadly no , layer 3-4 traffic
<RX14> @bararchy how about a realloc before you call the use_data
<RX14> damn, realloc is only available on pointer
<RX14> i should PR that in
<FromGitter> <bararchy> How will reloc help me ? Is it more efficant ?
<RX14> @bararchy i mean if it works fine you can just ignore the warning
<FromGitter> <bararchy> Well , it works fine , just annoying messages to the STDOUT :/
<RX14> don't think there's much you can do
<FromGitter> <bararchy> Is there a way to supress the messages ? \
<RX14> maybe
whomp has joined #crystal-lang
Philpax has quit [Ping timeout: 268 seconds]
balduin has joined #crystal-lang
whomp has quit [Ping timeout: 240 seconds]
<RX14> there's likely an env var
pduncan has joined #crystal-lang
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<FromGitter> <overnet> Hi All. Does Crystal lang support multi core CPU processing similar to Golang? If yes could someone please give an example of how it works in Crystal.
<oprypin> overnet, does not yet support multi core processing. some barely working example: https://gist.github.com/00953b336673719dba25
<RX14> @overnet go-like parellelism is coming before crystal 1.0
<Papierkorb> Go-like concurrency is already there though
<RX14> yup
<FromGitter> <overnet> @FromIRC thank you for your sample
<FromGitter> <overnet> @Papierkorb could you explain it please?
<FromGitter> <akzhan> @overnet by the way, multicore may be used by spawning more than one process using reuse_port option to handle incoming connections. like ⏎ ⏎ https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Crystal/kemal/server-postgres.cr#L112 ⏎ ⏎ and runner https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Crystal/kemal/setup-postgres.sh#L9 ...
<FromGitter> <akzhan> this is workaround while multithreading is not complete and merged into master branch.
pduncan has quit [Ping timeout: 258 seconds]
<FromGitter> <overnet> Ok, thank you. Will be this completed in the version 1.0?
<FromGitter> <overnet> @Papierkorb I did not get your point
<FromGitter> <akzhan> Yes, it is in roadmap
<FromGitter> <overnet> Thank you @akzhan
snsei has joined #crystal-lang
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 268 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest30747
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/vHTJC
<crystal-gh> crystal/master c87fc6d Ary Borenszweig: Compiler: fixed logic for macro vs. method resolution. Related to #236
<crystal-gh> crystal/master 6141bcd Ary Borenszweig: Codegen: add missing location to raise
<crystal-gh> crystal/master be703a2 Ary Borenszweig: Fixed wrong require in spec
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Guest30747 has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest69624
snsei has quit [Remote host closed the connection]
<FromGitter> <bararchy> Is anyone working on a mail server made in crystal ?
Guest69624 has quit [Ping timeout: 255 seconds]
Ven_ has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden pushed 1 new commit to master: https://git.io/vHTT4
<crystal-gh> crystal/master 503fc04 Akzhan Abdulin: We should retry shutdown on EINPROGRESS error. Fixes #3168. (#4433)...
Ven_ has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
TheLemonMan has joined #crystal-lang
Ven_ has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 272 seconds]
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 260 seconds]
balduin has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 258 seconds]
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 268 seconds]
<FromGitter> <drujensen> @bararchy I wonder if we can use crystal-libraries-needed to track what people are working on as well
<RX14> yeah people should comment when they start working on items
zipR4ND has quit [Ping timeout: 245 seconds]
yogg-saron has joined #crystal-lang
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 246 seconds]
fedruantine has joined #crystal-lang
<FromGitter> <bararchy> Hmmm maybe adding a got tag next to something someone took as a project ?
<FromGitter> <bararchy> Ohh, because it's a git issue you can just assign it to someone
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
bjz has joined #crystal-lang
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
snsei has joined #crystal-lang
<FromGitter> <bew> @bararchy I think you can only assign an issue to someone member of `crystal-lang`'s github organisation, not anyone..
snsei has quit [Ping timeout: 255 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 268 seconds]
<FromGitter> <johnjansen> @drujensen that was the plan, assign an issue to someone, so we all know whats on the agenda
<FromGitter> <johnjansen> @bararchy thanks for adding more to the crystal-libraries-needed issues
<FromGitter> <johnjansen> anyone who wants to take something on can be added easily :-)
<FromGitter> <johnjansen> ive added a bunch of you as collaborators
<Papierkorb> Could the issues have an actual use-case for them?
<FromGitter> <johnjansen> sounds like a great idea … I’ve added you as a collaborator, so you could put a note to that effect in the readme :-)
<Papierkorb> @jwoertink, if you need something more than Readline, maybe Fancyline does what you need (<- shameless plug)
whomp has joined #crystal-lang
whomp has quit [Ping timeout: 240 seconds]
greenbigfrog has quit [Quit: The server of my BNC just shutdown or got killed!!!]