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
zipR4ND has quit [Ping timeout: 240 seconds]
hightower2 has quit [Ping timeout: 255 seconds]
<FromGitter> <bigtunacan> I'm getting an error with some real basic code on the pg & db shards, but don't see what I'm doing wrong.
<FromGitter> <bigtunacan> https://carc.in/#/r/285n
<FromGitter> <bigtunacan> syntax error at or near "," (PQ::PQError) ⏎ 0x10cb6ee65: *CallStack::unwind:Array(Pointer(Void)) at ?? ⏎ 0x10cb6ee01: *CallStack#initialize:Array(Pointer(Void)) at ?? ⏎ 0x10cb6edd8: *CallStack::new:CallStack at ?? ⏎ 0x10cb6d281: *raise<PQ::PQError>:NoReturn at ?? [https://gitter.im/crystal-lang/crystal?at=5949d651e59e74be0a9d6e0b]
<FromGitter> <bigtunacan> Forget it; brain fart.
<FromGitter> <bigtunacan> I forgot you have to you $1, $2 syntax with PG adapter
<FromGitter> <bigtunacan> @fridgerator I took a look through the changes in the `pg` shard and it doesn't look like it broke from the last time.
<FromGitter> <bigtunacan> If you put a unique constraint on a field and then run this basic example I created here
<FromGitter> <bigtunacan> https://carc.in/#/r/285svvvvv
<FromGitter> <bigtunacan> Then `pg` just raises an exception of type `PQ::PQError` and gives a message `duplicate key value violates unique constraint`
Philpax has joined #crystal-lang
<FromGitter> <fridgerator> In what crystal-pg version do you see that error?
<FromGitter> <bigtunacan> It's on 0.13.3 which is latest.
<FromGitter> <bigtunacan> I'm not sure, but I believe it is related to this change in `pg`
<FromGitter> <bigtunacan> In src/pg.cr it switched how the connection is initialized to prevent a pool from being created.
<FromGitter> <bigtunacan> Then looking in the Crecto base adapter `def execute(conn, query_string, params)`
<FromGitter> <bigtunacan> I see that it branches differently `if conn.is_a?(DB::Database)`
<FromGitter> <bigtunacan> So I'm thinking maybe the change in pg could have switched the path it takes in Crecto?
<FromGitter> <bigtunacan> But I could be off base here; I've only looked at it for a few hours
<FromGitter> <fridgerator> the problem can be replicated without crecto
<FromGitter> <fridgerator> without crecto, I am unable to get that exception if I try and insert a duplicate record
<FromGitter> <bigtunacan> Do you have a code snippet?
<FromGitter> <fridgerator> its on the issue in crystal-pg and crystal-db
<FromGitter> <bigtunacan> That issue doesn't hang for me; instead I'm getting DB::ConnectionRefused
<FromGitter> <fridgerator> on the DB.open ?
<FromGitter> <bigtunacan> Yeah; I replaced it with my credentialed URI
<FromGitter> <fridgerator> ok
qard has joined #crystal-lang
<FromGitter> <bigtunacan> @fridgerator So that code at https://github.com/will/crystal-pg/issues/98 has problems
<FromGitter> <bigtunacan> The reason I couldn't connect is it creates the db using _ characters, but then queries with -
<FromGitter> <bigtunacan> Once I get past that it hangs, but to me that looks like it is because the code misuses the adapter.
<FromGitter> <bigtunacan> It is using `query` to try to do an `insert` and then loop over the results.
<FromGitter> <bigtunacan> But I would think you would be using the `exec` method for inserts.
<FromGitter> <bigtunacan> If you change it to an `exec` then it runs and raises the duplicate key message
<FromGitter> <bigtunacan> So; I think it shouldn't hang indefinitely. Should probably timeout or raise some generic invalid query message.
<FromGitter> <bigtunacan> But it also should not work.
<FromGitter> <fridgerator> hrmm ok,
<FromGitter> <fridgerator> It uses `query` because of the `returning *` bit. I don't think `exec` will return anything.
<FromGitter> <bigtunacan> It won't; exec returns an `ExecResult`
<FromGitter> <bigtunacan> so there is no result set to iterate
<crystal-gh> [crystal] jgaskins opened pull request #4601: Pretty-print objects in playground inspector (master...playground-value-formatting) https://git.io/vQUxW
<FromGitter> <fridgerator> Crecto is utilizing `returning *` so that it has the primary key for newly inserted records without a separate query
<FromGitter> <fridgerator> hrmmm
<FromGitter> <bigtunacan> Right; which I assume you need for your Changset?
<FromGitter> <fridgerator> yeah
<FromGitter> <bigtunacan> @fridgerator I think it would probably be best to make changes on `crystal-pg` and `Crecto` both
<FromGitter> <bigtunacan> I'm heading to bed; super tired now.
<FromGitter> <bigtunacan> I have a partial fix for crystal-pg. I'll keep looking at it from that side.
<FromGitter> <bigtunacan> @fridgerator I fixed the issue with the pg adapter hanging, but then that's just going to end up raising an exception which you would need to handle in Crecto.
<FromGitter> <bigtunacan> But that doesn't appear to be the only issue.
<FromGitter> <bigtunacan> The hanging forever is caused by the pg adapter not handling all of the exceptions it should be so it ends up in a state where it thinks the end of the result set hasn't been reached.
<FromGitter> <bigtunacan> So... to infinity and beyond...
<FromGitter> <bigtunacan> But it looks to me like that is just when you try to enumerate a result set which has received an error back.
<FromGitter> <bigtunacan> You could also do something like this
<FromGitter> <bigtunacan> db.query "INSERT INTO users(name) VALUES ($1)", "test"
<FromGitter> <bigtunacan> That can either work...
<FromGitter> <bigtunacan> or it can silently fail
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hightower2 has joined #crystal-lang
qard has joined #crystal-lang
hightower2 has quit [Ping timeout: 240 seconds]
qard has quit [Quit: Textual IRC Client: www.textualapp.com]
<FromGitter> <azzuwan> Mysql date field is still not supported by crystal-mysql any other alternatives?
<FromGitter> <akzhan> @bigtunacan @fridgerator please open/comment issue in crystal-pg with your details.
<FromGitter> <straight-shoota> Just searching for "lib" in the shards repo points to this: https://github.com/crystal-lang/shards/blob/066abcf29ff22b1ba8cc310fdbe24f079e9df301/src/config.cr#L18
<FromGitter> <bigtunacan> @akzhan The issue you already opened is related. I'm just working on the pull request for it now so no need for me to comment yet.
<FromGitter> <bigtunacan> I should have it finished in the next day or two at most.
<FromGitter> <akzhan> thanks @bigtunacan
<FromGitter> <sdogruyol> great @bigtunacan
<FromGitter> <bigtunacan> When I create the pull request I'll be sure to cross reference your issue so you are notified @akzhan
<FromGitter> <bigtunacan> From there you can also switch to using my fork if you need until it gets merged in.
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <bigtunacan> @azzuwan is DATETIME data type supported?
<FromGitter> <bigtunacan> If so you can use LEFT() and throw away the timestamp
<FromGitter> <akzhan> You can add support for custom data type as I suppose. But I’m busy on CLDR support now. ⏎ Btw, draft here - https://github.com/akzhan/crystal-cldr
<FromGitter> <sdogruyol> what's CLDR?
<FromGitter> <akzhan> http://cldr.unicode.org - basics of I18n
<FromGitter> <akzhan> I suppose that cldr-core will be done 24th
<FromGitter> <sdogruyol> that's great
<FromGitter> <sdogruyol> what'll you use it for?
<FromGitter> <akzhan> I need I18n library to develop multilingual sites. It will require cldr module.
<FromGitter> <akzhan> date time, currency, plurals etc. locale info
<FromGitter> <azzuwan> @bigtunacan Aha, nice trick there Joiey. I'm going to try that.
<FromGitter> <azzuwan> I want to help build the missing parts but I'm just getting started with Crystal.
zipR4ND has joined #crystal-lang
A124 has quit [Ping timeout: 240 seconds]
A124 has joined #crystal-lang
<FromGitter> <sdogruyol> did Ary left the core team https://github.com/orgs/crystal-lang/people ?
<FromGitter> <bew> I also noticed that by his "contributor" tag instead of "member", I'm not sure what it means for the project though
<RX14> well ary seems to still be able to merge PRs
<RX14> not sure if that changed in the last day
zipR4ND has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <sdogruyol> that's weird
rohitpaulk has quit [Remote host closed the connection]
<FromGitter> <faustinoaq> @sdogruyol yes, but could be a mistake :sweat_smile: or Ary is busy with something non-technical :worried:
A124 has quit [Ping timeout: 268 seconds]
A124 has joined #crystal-lang
splitty___ has joined #crystal-lang
imnotarobot has joined #crystal-lang
splitty__ has quit [Ping timeout: 276 seconds]
<FromGitter> <LuckyChicken91_twitter> when will crystal have multiline comments? Is it so hard to implement multiline comments?
<RX14> crystal won't have multiline comments
<RX14> use your ide
<RX14> select the block and use the comment shortcut
<FromGitter> <LuckyChicken91_twitter> why? why will crystal wont have multiline comments? :((
<FromGitter> <LuckyChicken91_twitter> thats really sad
<RX14> because they're confusing
<RX14> without syntax highlighting it's hard to see when the start/end
<RX14> it's easy to miss sometimes
<FromGitter> <LuckyChicken91_twitter> no!
<RX14> in general just having single-line comments is easier to interpret and your editor will do comments for you
<FromGitter> <LuckyChicken91_twitter> its not
<FromGitter> <LuckyChicken91_twitter> multiline comments arent confusing. Multiline comments are an essential feature of an programing language!
<RX14> well we've lasted many years without
<RX14> read this
<FromGitter> <LuckyChicken91_twitter> what are these #[ and #] meaning?
<RX14> that was the proposed syntax
<FromGitter> <LuckyChicken91_twitter> oh this is an idea
<RX14> yes
<FromGitter> <LuckyChicken91_twitter> i hoped its real :(
<RX14> it's a proposal
<FromGitter> <LuckyChicken91_twitter> and why is crystal not implementing this?!
<RX14> read the comments
<RX14> thats why i linked it
<FromGitter> <LuckyChicken91_twitter> are they really meaning that multiline comments are CONFUSING?
<FromGitter> <straight-shoota> yes they are
<RX14> yes for the reasons I said
<FromGitter> <LuckyChicken91_twitter> this means that ruby is in some things definitely better than crystal
<FromGitter> <straight-shoota> You can take look at languages that have multiline comments, like Java: `/*` and `*/` mark a multiline comment. Yet, most coding standards require to put ` *` in front of every line in the comment
<FromGitter> <sdogruyol> not necessarily @LuckyChicken91_twitter
<RX14> well i'd argue that it's better not to have them
<RX14> it's a matter of opinion
<RX14> and of course some languages are going to be ebtter than others at certain tasks
<RX14> noone ever claimed crystal is better than ruby at everything
<FromGitter> <LuckyChicken91_twitter> im sure the crystal team is just lazy
<FromGitter> <straight-shoota> you would consider `=begin` and `=end`as *good*
<RX14> of course not
<RX14> that was a PR
<RX14> they could have clicked one button and had them in the language
<RX14> but they chose to think and not merge
<RX14> that's the opposite of lazy
<FromGitter> <bew> :+1:
<FromGitter> <sdogruyol> you're not helpful with that words @LuckyChicken91_twitter
<RX14> i'm very glad we have an opinionated @asterite who keeps the language from being bloated
<FromGitter> <LuckyChicken91_twitter> wut? they could have clicked one button and had them in the language?! Does this maybe means that crystal is developed with Scratch? or something like this one-click-program-apps
<RX14> and doesn't just merge features to make people happy
<RX14> @LuckyChicken91_twitter no what I linked you was a pull request
<RX14> someone wrote the code for multiline comments
<RX14> and asked that it be included in crystal
<FromGitter> <LuckyChicken91_twitter> oohh
<RX14> and asterite decided not to accept that code
<FromGitter> <LuckyChicken91_twitter> "someone wrote the code for multiline comments" was this code written in crystal?
<RX14> yes
<FromGitter> <bew> yes
<RX14> you can see the code if you click the view diff button
<RX14> on the pr i linked
<RX14> sorry, "files changed"
<FromGitter> <LuckyChicken91_twitter> this means i can copy the code in crystal!
<FromGitter> <LuckyChicken91_twitter> and then i have multine lcoomments
<RX14> and then veryone who uses your code has to compile their own crystal compiler
<RX14> sure you can if you;re writing code for yourself
<RX14> but i wouldn't recommend it
<FromGitter> <LuckyChicken91_twitter> oh
<FromGitter> <LuckyChicken91_twitter> i need to compile my own crystal compiler?
<FromGitter> <straight-shoota> yes, the PR contains code for the compiler
<FromGitter> <straight-shoota> if you want to use it, you need to compile it yourself
<FromGitter> <LuckyChicken91_twitter> but its crystal code
<FromGitter> <LuckyChicken91_twitter> crystal code for crystal
<FromGitter> <straight-shoota> then you can have a compiler which recognizes multiline commends
<FromGitter> <LuckyChicken91_twitter> oh okay
<RX14> @LuckyChicken91_twitter the crystal compiler is written in crystal
<FromGitter> <LuckyChicken91_twitter> ik
<FromGitter> <bew> so new languages features are added to the compiler in crystal, then the compiler needs to be compiled, and finally you can use the added new languages features in some code, and compile it with the new fresh compiler you just compiled..
<FromGitter> <LuckyChicken91_twitter> ok i will write my own code
<RX14> well we only use the last compiler releases features in the compiler so you almost never need a stage2 compiler @bew
<FromGitter> <straight-shoota> by the way, Ruby technically doesn't have multiline comments either. `=begin`/`=end` designate a documentation block, not a comment.
<FromGitter> <straight-shoota> and I must say I have never used this
<FromGitter> <LuckyChicken91_twitter> i dont care. For me its an multiline comment
<FromGitter> <bew> RX14 true thanks for the clarification
<FromGitter> <LuckyChicken91_twitter> im bored
<FromGitter> <LuckyChicken91_twitter> can someone tell me what i should do
<FromGitter> <straight-shoota> enjoy the nice weather outside ;)
A124 has quit [Ping timeout: 260 seconds]
<FromGitter> <LuckyChicken91_twitter> what should i do outside
<FromGitter> <LuckyChicken91_twitter> theres nothing to do
<FromGitter> <sdogruyol> https://github.com/crystal-lang/crystal/pull/3582 @LuckyChicken91_twitter
<FromGitter> <LuckyChicken91_twitter> what is tis
<FromGitter> <bew> @LuckyChicken91_twitter contemplate the nature and think about the meaning of life
<FromGitter> <bew> this should take you a while
<FromGitter> <LuckyChicken91_twitter> uuhmm
imnotarobot has quit [Quit: Page closed]
A124 has joined #crystal-lang
<FromGitter> <fridgerator> thats easy, its 42
<FromGitter> <straight-shoota> @akzhan do you know https://github.com/twitter/twitter-cldr-rb ?
onionhammer has quit [Ping timeout: 246 seconds]
Philpax has quit [Ping timeout: 240 seconds]
hightower2 has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
Renich_ has joined #crystal-lang
Renich has quit [Ping timeout: 240 seconds]
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
Kug3lis is now known as Kug3lis_off
dannyAAM has joined #crystal-lang
A124 has quit [Read error: Connection reset by peer]
A124 has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
onionhammer has joined #crystal-lang
Kug3lis is now known as Kug3lis_off
Raimondi has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
onionhammer has quit [Read error: No route to host]
onionhammer has joined #crystal-lang
onionhammer has quit [Ping timeout: 246 seconds]
hightower2 has quit [Ping timeout: 260 seconds]
<FromGitter> <drosehn> Sure, the answer is easy, but what was the question?
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
<FromGitter> <fridgerator> :smile:
onionhammer has joined #crystal-lang
onionhammer1 has joined #crystal-lang
onionhammer has quit [Ping timeout: 255 seconds]
Raimondi has quit [Quit: WeeChat 1.8-dev]
Kug3lis is now known as Kug3lis_off
Raimondi has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <delef> What is exception? ⏎ ⏎ argument 'entry_data_list' of 'GeoIP2::LibMMDB#get_entry_data_list' must be Pointer(Pointer(GeoIP2::LibMMDB::EntryDataListS)), not Poi ⏎ nter(GeoIP2::LibMMDB::EntryDataListS) [https://gitter.im/crystal-lang/crystal?at=594ab4f988348abd0ab55769]
<FromGitter> <delef> WTF
<FromGitter> <delef> Pointer(Pointer())?
<oprypin> that's C for ya
rohitpaulk has quit [Ping timeout: 255 seconds]
<oprypin> you need `entry_data_list = uninitialized LibMMDB::EntryDataListS*`
wmoxam_ is now known as wmoxam
wmoxam has quit [Changing host]
wmoxam has joined #crystal-lang
onionhammer1 has quit [Ping timeout: 246 seconds]
onionhammer1 has joined #crystal-lang
onionhammer1 has quit [Ping timeout: 240 seconds]
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
onionhammer1 has joined #crystal-lang
<FromGitter> <akzhan> @straight-shoota no, i haven’t seen twitter-cldr. thanks for the link. anyway my shard is very base like «resources» chapter of twitter-cldr gem. and it is more crystal language driven (no yaml data files, updates for fast llvm compilation etc.)
<FromGitter> <LuckyChicken91_twitter> somebody know a good crystal framework/gui library
<FromGitter> <akzhan> by the way, is any PUG parser exists for Crystal?
<FromGitter> <bew> You meant peg parser?
<FromGitter> <akzhan> oops yeah :)
<FromGitter> <bew> No, no usable solution yet
<FromGitter> <LuckyChicken91_twitter> nobody knows a crystal framework/library?
<FromGitter> <bew> @akzhan There was Parsh iirc, but the guy stoped the project and used rust instead
<FromGitter> <akzhan> @bew I need something to parse https://github.com/nodeca/babelfish/blob/master/src/parser.pegjs grammar
<FromGitter> <bew> And I have a project myself, astral, but I'm just throwing ideas (in the wiki) atm
<FromGitter> <akzhan> I'm too stupid to write my own PEG parser :)
hako_ has joined #crystal-lang
<FromGitter> <bew> I'm sure you're not :D
<FromGitter> <bew> A simple, on-purpose PEG parser is not that hard you know
<FromGitter> <akzhan> Oh sure. I will do after CLDR, apparently. Sometimes the absence of standard things strains.
<FromGitter> <akzhan> @LuckyChicken91_twitter no one. You may be first to build QT bindings for example.
<FromGitter> <bew> Lucky, a framework/lib to do what?
<FromGitter> <akzhan> One of the best frameworks to build GUI apps is Electron today (JS ecosystem). ⏎ And WPF too (.NET ecosystem). ⏎ ⏎ Not QT anyway. [https://gitter.im/crystal-lang/crystal?at=594ad99fcf9c13503cae022c]
<Papierkorb> urgh electron
<FromGitter> <akzhan> Slack, Gitter, VSCode afair
<Papierkorb> only because it's used doesn't make it good. deploying a vuln ridden browser with every application is not a good idea.
gewo has quit [Ping timeout: 268 seconds]
<FromGitter> <akzhan> It is just for «rapid application development».
<Papierkorb> not to mention the waste of memory and cpu time. "but computers are getting faster anyway!" and programs are getting slower at the same time, easily outbalancing the higher computing power
<FromGitter> <straight-shoota> the implementation is weak, but the concept of using web components to build GUIs for native apps is not a bad idea itself.
<FromGitter> <akzhan> Performance / development cost balance.
<Papierkorb> Economic factors may be, but that doesn't make it a good program. just a cheap one to create.
<FromGitter> <akzhan> Yes, of course. Ans VSCode is good catch.
hako__ has joined #crystal-lang
hako_ has quit [Ping timeout: 268 seconds]
sz0 has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
onionhammer1 has quit [Ping timeout: 260 seconds]
Renich_ has quit [Ping timeout: 246 seconds]
onionhammer1 has joined #crystal-lang
onionhammer1 has quit [Ping timeout: 240 seconds]
onionhammer1 has joined #crystal-lang
onionhammer1 has quit [Ping timeout: 240 seconds]
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
Kug3lis is now known as Kug3lis_off
danielpclark has joined #crystal-lang
Kug3lis has joined #crystal-lang
Kug3lis_off has quit [Read error: Connection reset by peer]
Kug3lis has quit [Ping timeout: 240 seconds]
Kug3lis has joined #crystal-lang