00:28
alexherbo231 has quit [Remote host closed the connection]
02:13
<
FromGitter >
<randiaz95> Sup gang!
02:13
<
FromGitter >
<randiaz95> Any one down to write a stripe api for Crystal?
02:15
<
FromGitter >
<Blacksmoke16> o/
02:15
<
FromGitter >
<randiaz95> lol
02:16
<
FromGitter >
<randiaz95> Also, wondering if there was a gem/pip package manager equivalent in the works for Crystal?
02:17
<
FromGitter >
<randiaz95> great! I thought it was a dependency manager
02:17
<
FromGitter >
<randiaz95> got confused,
02:17
<
FromGitter >
<randiaz95> gonna google a library repo for shards
02:17
<
FromGitter >
<Blacksmoke16> `crystal init lib my_app`
02:18
<
FromGitter >
<Blacksmoke16> and sorry, yes its just a dep manager
02:19
<
FromGitter >
<Blacksmoke16> package manager meaning what?
02:19
<
FromGitter >
<randiaz95> I am a little confused as to the definition, and how it differs from package managers
02:19
<
FromGitter >
<Blacksmoke16> shards handles installing other crystal libraries into your project
02:20
<
FromGitter >
<randiaz95> well, I guess that would be what I am looking for lol
02:21
<
FromGitter >
<randiaz95> Blacksmoke, thanks for the help!
02:21
<
FromGitter >
<randiaz95> I am gonna come back after making myself a rum n coke
02:21
<
FromGitter >
<randiaz95> then I will be ready to learn to make a shard
02:55
<
FromGitter >
<randiaz95> Hey Blacksmoke, I initialized a new package, should all my code be in separate files and imported into the module?
02:56
<
FromGitter >
<Blacksmoke16> its common to have `src/my_app.cr` just require all the other code located in `src/my_app/`
02:56
<
FromGitter >
<Blacksmoke16> as `my_app.cr` is what would get required when someone does `require "my_app"`
02:56
<
FromGitter >
<Blacksmoke16> after installing it
02:57
<
FromGitter >
<Blacksmoke16> i use a more hybrid approach where the root file `src/my_app.cr` includres required files, but also defines stuff common to that module (like the docs on the module itself etc)
02:58
<
FromGitter >
<Blacksmoke16> depends on if your project will have one requireable thing or more than one
03:03
<
FromGitter >
<randiaz95> That makes sense.
03:04
<
FromGitter >
<randiaz95> im finding the documentation a little insequential
03:04
<
FromGitter >
<randiaz95> im jumping back and forth alot lol.
03:05
<
FromGitter >
<Blacksmoke16> yea theres not really a "guided tutorial" per say anywhere atm
03:05
<
FromGitter >
<randiaz95> would love to learn about alias and property, I am looking at a shard called stats and
03:06
<
FromGitter >
<randiaz95> it's a lot of those in main my_app.cr
03:06
<
FromGitter >
<randiaz95> Im guessing the constructor for the shard
03:06
<
FromGitter >
<Blacksmoke16> `property` is just a macro that defines a getter and setter for that ivar
03:07
<
FromGitter >
<Blacksmoke16> similar to ruby's like `attr_accessor`
03:07
<
FromGitter >
<Blacksmoke16> just named better :p
03:07
<
FromGitter >
<randiaz95> ah brilliant
03:07
<
FromGitter >
<randiaz95> I love that :D
03:07
<
FromGitter >
<randiaz95> attr_accessor was a little cryptic, but in the context of ruby it looked super cryptic
03:10
<
FromGitter >
<randiaz95> dude thanks for the major support, i have only worked professionally with python and SQL and my learning curve is big
03:10
<
FromGitter >
<Blacksmoke16> np
03:13
<
FromGitter >
<randiaz95> What are you currently working on blacksmoke?
03:15
<
FromGitter >
<Blacksmoke16> rewriting my web framework, decided on some design changes that'll make it better/more flexible/easier to maintain than before
03:15
<
FromGitter >
<randiaz95> oo super cool, is it a microframework or more like django sinatra
03:16
<
FromGitter >
<Blacksmoke16> its more so inspired by symfony, current plan is to KISS and focus on JSON REST APIs
03:17
<
FromGitter >
<randiaz95> im ignorant of php frameworks :/
03:17
<
FromGitter >
<Blacksmoke16> crystal has quite a few web frameworks, so mainly just going for a niche versus a full feature framework like lucky
03:17
<
FromGitter >
<randiaz95> ah
03:18
<
FromGitter >
<Blacksmoke16> plus afaik im the only one that has an annotation based framework, so that makes it a bit neat too i suppose
03:18
<
FromGitter >
<randiaz95> Sorry im ignorant of annotation based
03:19
<
FromGitter >
<Blacksmoke16> familiar with rails?
03:19
<
FromGitter >
<randiaz95> no, only sinatra in ruby,
03:19
<
FromGitter >
<randiaz95> do you mean like cli commands?
03:20
<
FromGitter >
<Blacksmoke16> in that case, in sinatra routes are defined by doing like
03:20
<
FromGitter >
<randiaz95> right
03:20
<
FromGitter >
<randiaz95> its a dsl
03:20
<
FromGitter >
<Blacksmoke16> in rails they're defined in a file like `get '/patients/:id', to: 'patients#show'`
03:20
<
FromGitter >
<Blacksmoke16> that ties a route to a specific method in a controller class
03:20
<
FromGitter >
<randiaz95> ah like urls in django
03:21
<
FromGitter >
<randiaz95> django has a urls file that is separate from the business logic
03:21
<
FromGitter >
<Blacksmoke16> where in my thing stuff is defined like
03:21
<
FromGitter >
<randiaz95> of each route's function/class
03:22
<
FromGitter >
<randiaz95> interesting...
03:23
<
FromGitter >
<randiaz95> is < ART::Controller a mixin or inheritance?
03:23
<
FromGitter >
<Blacksmoke16> inheritance
03:23
<
FromGitter >
<Blacksmoke16> can define methods on there that all controllers should have, like helper methods for doing redirects etc
03:23
<
FromGitter >
<randiaz95> would be interesting if you can get the initializer of the child class to set the port
03:24
<
FromGitter >
<randiaz95> right
03:24
<
FromGitter >
<Blacksmoke16> port gets set when you start the server
03:24
<
FromGitter >
<Blacksmoke16> like `ART.run(port: 1234)`
03:25
<
FromGitter >
<Blacksmoke16> ideally you'd have like nginx in front of it
03:25
<
FromGitter >
<randiaz95> how does ART.run get the child class' functions? MyController.run(port: 1234) seems like what I wouldve tried.
03:25
<
FromGitter >
<randiaz95> yeah nginx serves port 80
03:26
<
FromGitter >
<randiaz95> and your servers are listening to other ports
03:26
<
FromGitter >
<randiaz95> do crystal http servers run on systemd services?
03:26
<
FromGitter >
<Blacksmoke16> is what it is atm (WIP)
03:27
<
FromGitter >
<randiaz95> interesting, wifi port as default?
03:27
<
FromGitter >
<Blacksmoke16> some compile time magic happens that "registers" each controller/route at compile time
03:27
<
FromGitter >
<randiaz95> hm
03:27
<
FromGitter >
<Blacksmoke16> wip :P is what my finger was on at the time
03:28
<
FromGitter >
<randiaz95> so {% %} is metaprogramming stuff right?
03:28
<
FromGitter >
<randiaz95> sry not there yet lol
03:29
<
FromGitter >
<Blacksmoke16> yea it has its own learning curve ha
03:31
<
FromGitter >
<randiaz95> It's wierd, this language seems fully functional. but people call it not production ready
03:32
<
FromGitter >
<Blacksmoke16> looks a lot more complicated then it is, essentially just iterate over each child controller type, new it up, iterate over routes, using other annotations for like query params and stuff, then finally add a wrapper type to the router tree
03:32
<
FromGitter >
<Blacksmoke16> mainly due to the breaking changes ^, API isn't stable yet
03:32
<
FromGitter >
<Blacksmoke16> so each release has some
03:35
<
FromGitter >
<randiaz95> ah
03:35
<
FromGitter >
<randiaz95> interesting
03:35
<
FromGitter >
<randiaz95> [] of Controller ;)
03:35
<
FromGitter >
<randiaz95> I love what I see man, I might invest 100 bucks this christmas
03:38
<
FromGitter >
<Blacksmoke16> 👍
03:45
<
FromGitter >
<Blacksmoke16> doing anything*
03:47
<
FromGitter >
<watzon> What am I looking at @Blacksmoke16?
03:47
<
FromGitter >
<Blacksmoke16> quick benchmark i did of my athena rewrite on an endpoint that just returns `"Hello world"`
03:48
<
FromGitter >
<watzon> Ahh nice
03:48
<
FromGitter >
<Blacksmoke16> should also note is MT mode with 6 workers
03:48
<
FromGitter >
<Blacksmoke16> single thread is like 80k iirc
03:48
<
FromGitter >
<Blacksmoke16> 83k/sec*
03:51
<
FromGitter >
<watzon> That's really not bad, even single threaded
03:51
<
FromGitter >
<Blacksmoke16> indeed
03:51
<
FromGitter >
<Blacksmoke16> 95% of the credit goes to crystal stdlib ha
03:54
<
FromGitter >
<randiaz95> lol
03:54
<
FromGitter >
<randiaz95> me here, trying to run the simple http/server without an error
03:54
<
FromGitter >
<randiaz95> Crystal 0.32.0 (2019-12-12) gives me libssl missing error
03:54
<
FromGitter >
<randiaz95> `library not found for -lssl (this usually means you need to install the development package for libssl`
03:54
<
FromGitter >
<Blacksmoke16> are you on new mac os version?
03:54
<
FromGitter >
<randiaz95> probably.
03:55
<
FromGitter >
<randiaz95> Mojave
03:55
<
FromGitter >
<randiaz95> I've skipped tons of updates though
03:55
<
FromGitter >
<randiaz95> should I update clang or llvm?
03:56
<
FromGitter >
<Blacksmoke16> :p
03:57
<
FromGitter >
<randiaz95> 1) o lol
03:58
<
FromGitter >
<randiaz95> so much for not booting up my ubuntu vm
03:59
<
FromGitter >
<randiaz95> ahh.. such a relief too, after reinstalling crystal I restarted vscode and my text editor finally colored the syntax of crystal lol
04:00
<
FromGitter >
<randiaz95> colored syntax => professional programmer lol
04:02
<
FromGitter >
<Blacksmoke16> nice one
04:32
<
FromGitter >
<randiaz95> library not found for -lssl Wahtadafagg
04:32
<
FromGitter >
<randiaz95> :( i have openssl installed and in environment
04:32
<
FromGitter >
<Blacksmoke16> did you try and uninstall and reinstall crystal?
04:33
<
FromGitter >
<randiaz95> ima re uninstall
04:33
<
FromGitter >
<randiaz95> but yeah
04:33
<
FromGitter >
<randiaz95> my path is diff
04:33
<
FromGitter >
<randiaz95> i had /usr/local/Cellar***
04:33
<
FromGitter >
<randiaz95> brew is Cellar nowadays
04:34
<
FromGitter >
<Blacksmoke16> id try that one as well if it still doesnt work tho
04:35
<
FromGitter >
<randiaz95> neither
04:35
<
FromGitter >
<randiaz95> and both dirs exist
04:36
<
FromGitter >
<randiaz95> uninstalled and reinstalled
04:36
<
FromGitter >
<randiaz95> on both paths
04:36
<
FromGitter >
<Blacksmoke16> uninstalled and reinstalled crystal itself?
04:37
<
FromGitter >
<randiaz95> yeah
04:38
<
FromGitter >
<randiaz95> wierd
04:38
<
FromGitter >
<randiaz95> when printing out the env variable
04:38
<
FromGitter >
<randiaz95> it states: No such file or directory
04:40
<
FromGitter >
<Blacksmoke16> dunno
04:41
<
FromGitter >
<randiaz95> ugh..
04:41
<
FromGitter >
<randiaz95> dude... I wasnt using the unix command export..
04:41
<
FromGitter >
<Blacksmoke16> rip
04:41
<
FromGitter >
<randiaz95> lol.. I had python, flutter, golang paths all with export in my bash_profile
04:41
<
FromGitter >
<randiaz95> that will do it..
04:42
<
FromGitter >
<randiaz95> its so wierd, I thought it was ok because I was echoing the var from cli
04:42
<
FromGitter >
<randiaz95> and it was showing the correct path...
04:42
<
FromGitter >
<randiaz95> lol
04:45
<
FromGitter >
<randiaz95> Blacksmoke, did you study cs?
04:45
<
FromGitter >
<randiaz95> I studied Economics
04:45
<
FromGitter >
<Blacksmoke16> yes
04:46
<
FromGitter >
<randiaz95> I <3 CS
04:52
<
FromGitter >
<randiaz95> Wow, this new movie on netflix 6 underground is good
05:20
<
FromGitter >
<randiaz95> yo blacksmoke u there?
05:24
<
FromGitter >
<randiaz95> would love to learn how cors works
05:34
<
FromGitter >
<randiaz95> first shard ever...
06:27
<
Yxhuvud >
I wonder what the undefined reference to `__muloti4' errors I got when using i128 in todays advent of code is.
07:29
<
FromGitter >
<watzon> Yxhuvud: In crystal?
07:58
ht_ has joined #crystal-lang
08:31
DTZUZO has quit [Ping timeout: 252 seconds]
08:33
<
Yxhuvud >
yes. probably some issue with Int128. I'll see if I can reduce it.
09:31
<
Yxhuvud >
Uh. That reduced a bit more than I expected. `1i128 * 1i128` fails to compile for me. o_O
09:42
<
Yxhuvud >
Seems wontruefree have an WIP branch for it.
14:09
<
FromGitter >
<Blacksmoke16> @randiaz95 I am now
14:11
woodruffw has quit [Ping timeout: 268 seconds]
14:13
woodruffw has joined #crystal-lang
14:51
woodruffw has quit [Ping timeout: 265 seconds]
14:53
woodruffw has joined #crystal-lang
15:02
<
FromGitter >
<Blacksmoke16> ogh, found some obscure compiler bug i cant seem to figure out :/
15:02
<
FromGitter >
<tenebrousedge> poke it with a stick
15:02
<
FromGitter >
<Blacksmoke16> `Error: can't infer the type of instance variable '@type' of Athena::Routing::Parameters::RequestParameter(HTTP::Request)`
15:03
<
FromGitter >
<Blacksmoke16> `getter type : T.class`
15:03
<
FromGitter >
<Blacksmoke16> its a generic and i can see the type right there...
15:03
<
FromGitter >
<tenebrousedge> can you use generics like that?
15:03
<
FromGitter >
<Blacksmoke16> i mean everything works fine, only seems to happen in my spec
15:03
<
FromGitter >
<tenebrousedge> hmmmm
15:04
<
FromGitter >
<tenebrousedge> does it bug if you write out the getter method explicitly (and add the return type) ?
15:05
<
FromGitter >
<Blacksmoke16> no, but then errors on another ivar :S
15:05
<
FromGitter >
<Blacksmoke16> on `@default`
15:07
<
FromGitter >
<tenebrousedge> does the type binding happen before or after macro expansion?
15:08
<
FromGitter >
<Blacksmoke16> im not sure, but im not even using macros
15:08
<
FromGitter >
<tenebrousedge> `getter` is a macro
15:08
<
FromGitter >
<Blacksmoke16> let me try manually defining it
15:10
<
FromGitter >
<Blacksmoke16> nope
15:12
<
FromGitter >
<tenebrousedge> `: T.class = T` looks weird to me
15:12
<
FromGitter >
<tenebrousedge> what is this doing?
15:12
<
FromGitter >
<Blacksmoke16> it stores the type
15:12
<
FromGitter >
<Blacksmoke16> need to do `T.class` so its not restricted to an instance of `T`
15:12
<
FromGitter >
<Blacksmoke16> i.e. in this case it stores `HTTP::Request` not an instance of `HTTP::Request`
15:17
DTZUZO has joined #crystal-lang
15:17
<
FromGitter >
<Blacksmoke16> ill start commenting stuff out and see if i can make it happen in the playground
15:29
<
FromGitter >
<Blacksmoke16> im super confused
15:29
<
FromGitter >
<Blacksmoke16> apparently changing the order of my `it` blocks makes it not happen anymore
15:30
<
FromGitter >
<Blacksmoke16> now we're getting somewhere
15:37
* FromGitter
* tenebrousedge eyes the tests suspiciously
15:41
<
FromGitter >
<bajro17> @watzon I cant wait brother :) I wish you all luck of this world
15:44
<
FromGitter >
<Blacksmoke16> works fine if you move the non empty array above the empty array
15:48
<
FromGitter >
<tenebrousedge> so weird. Probably worth filing a bug
15:49
<
FromGitter >
<Blacksmoke16> most annoying thing is not being able to have an array of types with a generic without having the parent type that does nothing
16:19
<
FromGitter >
<Blacksmoke16> first spec i ever wrote that uses `.should be`
16:55
<
FromGitter >
<Blacksmoke16> ogh, it came up again :/
17:15
<
FromGitter >
<Blacksmoke16> found a workaround \o/
17:18
<
FromGitter >
<christopherzimmerman> I have had an issue with certain tests causing compiler bugs only some of the time. For me, it was changing the order in which I allocated memory in a test.
17:18
<
FromGitter >
<christopherzimmerman> But I could only reproduce them like ~25% of the time.
17:18
<
FromGitter >
<Blacksmoke16> maybe find a seed that causes it?
17:18
<
FromGitter >
<Blacksmoke16> now that you can randomize specs
17:21
<
FromGitter >
<Blacksmoke16> `BUG: trying to downcast Athena::Routing::Parameters::Parameter(String) <- Athena::Routing::Parameters::PathParameter(String) (Exception) ⏎ `
17:21
<
FromGitter >
<Blacksmoke16> 😐
17:31
HumanG33k has joined #crystal-lang
17:32
HumanG33k has quit [Remote host closed the connection]
17:32
HumanG33k has joined #crystal-lang
17:34
<
FromGitter >
<Blacksmoke16> at this point i might just say screw unit tests
17:34
<
FromGitter >
<Blacksmoke16> and test everything via e2e
17:34
<
FromGitter >
<tenebrousedge> D:
17:35
<
FromGitter >
<Blacksmoke16> lol ikr? when i fix one compiler bug i get another :S
17:35
<
FromGitter >
<Blacksmoke16>
*doom*
17:36
<
FromGitter >
<tenebrousedge> gotta catch 'em all! Bugemon!
17:36
<
FromGitter >
<Blacksmoke16> now if only i knew the compiler enough to fix them, id be golden ha
18:15
sagax has quit [Quit: Konversation terminated!]
18:52
_whitelogger has joined #crystal-lang
20:18
<
FromGitter >
<Blacksmoke16> much easier and no compile errors :p
20:19
<
FromGitter >
<Blacksmoke16> ideally these would be unit tests but meh
20:20
sagax has joined #crystal-lang
21:37
<
FromGitter >
<didactic-drunk> @christopherzimmerman I have the opposite with compiler bugs. They don't trigger in shard specs, but do when I integrate the shards in a larger program.
21:44
<
FromGitter >
<Blacksmoke16> tl;dr use named or positional arguments for the main argument to the annotation?
21:44
<
FromGitter >
<Blacksmoke16> or option 3, support both
22:00
ht_ has quit [Remote host closed the connection]
22:15
<
FromGitter >
<watzon> Why not both?
22:15
<
FromGitter >
<watzon> I like option 3
22:16
<
FromGitter >
<Blacksmoke16> i think i do as well
22:46
<
raz >
i tend to prefer named args for everything, they just help readability so much
22:46
<
raz >
just my 2cents tho
22:48
<
FromGitter >
<Blacksmoke16> guess thats a benefit of option 3, can do it either way