<FromGitter>
<faustinoaq> Well, 45 is a good start 😅
<FromGitter>
<marksiemers> npm works on volume - everything is "unopinionated" and "pluggable". It's the quintessential place for "Yet another **_"
immaletyoufinish has joined #crystal-lang
<immaletyoufinish>
hello
<immaletyoufinish>
does anyone know what are the goals for the Lucky web framework? Does it aim to be a fully fledged framework like Rails/Amber or something smaller?
<wmoxam>
`The goal: catch bugs early, forget about most performance issues, and spend more time on code instead of debugging and writing tests.`
<immaletyoufinish>
wmoxam: I feel like those are already Crystal's goals in some capacity
<immaletyoufinish>
I just was wondering if this is going to be a lightweight framework or compete with Amber
<Papierkorb>
looked more heavy- than lightweight to me
<Papierkorb>
> I love crystal yet it puzzles me how the heroic developers can make rapid progress when each compilation of the compiler takes half a minute.
<Papierkorb>
OP should really retire their museum-grade computer
<Papierkorb>
Bonus points that I would have to register with disqus to report a comment
alex`` has joined #crystal-lang
immaletyoufinish has quit [Quit: Page closed]
<FromGitter>
<faustinoaq> Papierkorb, I already reported the spam account on disqus
<FromGitter>
<faustinoaq> > I love crystal yet it puzzles me how the heroic developers can make rapid progress when each compilation of the compiler takes half a minute. ⏎ ⏎ Papierkorb, using `amber watch` just the first compilation takes around 20s in my old Intel Celeron, the next compilations (reload on changes using sentry) take just 5s or less.
<FromGitter>
<faustinoaq> Now imagine on faster computers like latest i5 i7 with enough memory. and proper configuration 😄
csk157_1 has joined #crystal-lang
csk157_1 has quit [Ping timeout: 260 seconds]
dviola has quit [Quit: WeeChat 1.9.1]
_whitelogger has joined #crystal-lang
<crystal-gh>
[crystal] javanut13 opened pull request #5206: Add macro methods to ProcNotation and ProcLiteral (master...macro-methods-for-procs) https://git.io/vFIbv
csk157_1 has joined #crystal-lang
csk157_1 has quit [Ping timeout: 248 seconds]
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
csk157_1 has joined #crystal-lang
csk157_1 has quit [Ping timeout: 252 seconds]
DTZUZO has joined #crystal-lang
csk157_1 has joined #crystal-lang
csk157_1 has quit [Ping timeout: 255 seconds]
<FromGitter>
<unreadable> Morning all
tdc has joined #crystal-lang
DTZUZO has quit [Ping timeout: 248 seconds]
<watzon>
So there's not a Time string converter for the JSON module is there? Something that would take "2015-05-05T23:40:27Z" and parse it into a Time object?
<Yxhuvud>
JSON has no concep of timestamps.
<Yxhuvud>
but you may want to look into JSON#mapping
<RX14>
Papierkorb, i don't have access to that
RickHull has quit [Ping timeout: 260 seconds]
<RX14>
and Papierkorb, it really does take a good 30s
csk157_1 has joined #crystal-lang
<RX14>
huh
<RX14>
rm -Rf ~/.cache/crystal made the "cached" build drop from 25s to 15s
<RX14>
i think we need to shard the directories so they have few children and have some sort of automatic cleanup
csk157_1 has quit [Ping timeout: 246 seconds]
<watzon>
YYxhuvud: Lol I think you misunderstand. I am using JSON.mapping already, and just wondering if a converter has been written already that takes a String and parses it into Time.
<watzon>
Similar to the EpochConverter, but with strings instead of ints
<RX14>
well it depends on the format of the time
<RX14>
your format is ISO8601
<RX14>
and yes, we have a Time::Format::ISO_8601_DATE_TIME
<RX14>
which will work as a converter
<watzon>
Oh it will now?
<watzon>
Well that's good to hear
<RX14>
well it has to_json and from_json methods
<RX14>
all time formatters have
<FromGitter>
<Rinkana> Morning
<oprypin>
RX14, putting this cache not in /tmp is basically a crime
<FromGitter>
<bew> Hello here! How can I debounce a Channel? like if I receive nothing for 0.1 second, do something, else do something else?
<Papierkorb>
bew, timeouts are dangerous. Not because how you do them (as opposed to ruby), but in that the timed out fiber keeps processing. E.g., a timed out network request will still be running in the background
<FromGitter>
<bew> thanks @oprypin !
<FromGitter>
<bew> Thanks for the warning Papierkorb, but it should play well for me
<oprypin>
but then what options do we have for timeouts?
<Papierkorb>
none and that's the issue
<Papierkorb>
RX14 was working on something some months ago that let you inject an exception into another fiber which would've fixed it.
<Yxhuvud>
at least not before proper thread support. After that, perhaps something could be possible?
<Papierkorb>
No?
<Papierkorb>
How is that supposed to help?
<Yxhuvud>
well if you have something else that is running at the same time, then at least you have something else that could do *something*.
<Papierkorb>
Um someone is doing something just fine even now
<Papierkorb>
It's just that a running timed out request keeps actually running
<Papierkorb>
Which may return eventually and still do the work that's not wanted anymore
<Papierkorb>
Or keep on consuming a handle here or there, effectively leaking it
<Papierkorb>
Or consume other resources
<oprypin>
welp this is hard
<Papierkorb>
the sockets support a read/write time out, but that doesn't fix all problems.
<Papierkorb>
No idea if e.g. the http client allows you to set a timeout.
<Papierkorb>
oprypin: Injecting exceptions fixes the issue nicely
<oprypin>
hm yeah actually it does
<Papierkorb>
they can be caught and properly handled
<oprypin>
or not caught, then caught by select
<Yxhuvud>
but then you get the same issues as timeouts in ruby-land, no?
<Papierkorb>
No?
<Yxhuvud>
isn't that how timeouts are solved there?
<Papierkorb>
oprypin: You'd have to inject the Timeout exception into the timed out fiber, so only that fiber would "crash" if you decide to not handle it in there
<oprypin>
i get it
<oprypin>
there can be multiple timed out fibers at once tho
<Papierkorb>
In theory sure, you could simply inject an exception in all of those you're waiting for
<oprypin>
oh Timeout module lol... what could go wrong
<Papierkorb>
Exception injection would also help for (effectively) deadlocked channel sends/receives
<oprypin>
what Python does is just have every function implement its own timeout
<oprypin>
though i would be surprised if the modern event loop alternatives in Python don't have timeouts implemented like we're discussing here
FromGitter has quit [Remote host closed the connection]
oprypin has quit [Quit: Bye]
FromGitter has joined #crystal-lang
oprypin has joined #crystal-lang
<FromGitter>
<simaoneves> Is it feasible to do AOP in Crystal?
<FromGitter>
<simaoneves> with macros
<FromGitter>
<Rinkana> Hmm interesting
<FromGitter>
<Rinkana> I've never heard of AOP
<Papierkorb>
simanoneves, Can't tell you if it's feasible, but from what I read on AOP, you should be able to do many things of it with macros
<Papierkorb>
simanoneves, if all you want is method call monitoring, you can do that with macros
<Papierkorb>
I'm not sure yet if that is actually a good idea in all cases, but...
<FromGitter>
<faustinoaq> > npm works on volume - everything is "unopinionated" and "pluggable". It's the quintessential place for "Yet another _" ⏎ ⏎ @marksiemers Well, we have a few already
<crystal-gh>
[crystal] MakeNowJust opened pull request #5208: Fix to parse regex starting with ';' after call (master...fix/crystal/parse-regex-starting-semicolon-after-call) https://git.io/vFLq4
<crystal-gh>
[crystal] lbguilherme opened pull request #5209: Give error if using instance_sizeof on a generic type without type vars (master...instance_sizeof) https://git.io/vFLqd
csk157_1 has joined #crystal-lang
csk157_1 has quit [Ping timeout: 248 seconds]
<FromGitter>
<simaoneves> I think some stuff is possible yes, but not all, i don't know, thats why i was asking :)
<FromGitter>
<simaoneves> the idea would be to weave additional behaviour on the compilation step, without writing it in the class that would get the behaviour
<FromGitter>
<simaoneves> i havent worked with macros yet, might think about it later :)
<Papierkorb>
As I said, if you're interested in the monitoring aspect, you can do that with macros
<FromGitter>
<simaoneves> yap, thanks 👍
csk157_1 has joined #crystal-lang
csk157_1 has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
csk157_1 has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
csk157_1 has quit [Quit: WeeChat 1.9.1]
csk157 has joined #crystal-lang
<Papierkorb>
Ah great I can't support Ubuntu LTS 16.04 OOTB because there's no source package available for Qt5.5?
<Papierkorb>
Not APT stuff, but directly from Qt
<Papierkorb>
5.6 onwards is no issue
<Papierkorb>
Ah well, let that be the issue of those who care about using an archaic operating system
<jrwren>
why the need for source tarball from Qt instead of the source deb?
<Yxhuvud>
my favorite is when they backport stuff without proper quality assurance.
<Papierkorb>
That's not hosted on qt.io/ and thus not supported by me in any way jrwren
<jrwren>
ok Papierkorb.
<Papierkorb>
jrwren: I'm a single guy. I can't maintain every random source package that's out there.
<jrwren>
it *shouldn't* be a random source package, yet I understand your POV
<Papierkorb>
if someone wants to, they should step up
<Papierkorb>
Yxhuvud: Didn't ubuntu also completely thrash Gtk3?
<Papierkorb>
or was it gtk3 that just didn't care about semver?
<Yxhuvud>
dunno. I was speaking from experience of centos/redhat
<Yxhuvud>
and their packaging of gems in particular.
<Papierkorb>
Ah, someone in #qt knew the link to the source archive
snsei has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
<FromGitter>
<HCLarsen> I just noticed that while there is a gsub method for strings, there's no gsub! Is there a reason for this?
<Yxhuvud>
strings are immutable.
<FromGitter>
<acangiano_twitter> Strings are immutable in Crystal
<FromGitter>
<HCLarsen> Ohhh. Is there a mutable subclass like in Obj-C?
<FromGitter>
<acangiano_twitter> It's also worth noting that Crystal is a language that tries to prevent nil values as much as possible, unless you are explicitly asking for them. In Ruby, so many nils are caused by sneaky gsub! not finding the pattern within the string.
<FromGitter>
<acangiano_twitter> What are you trying to d, Chris?
<FromGitter>
<HCLarsen> Replace a character with a different character.
<FromGitter>
<acangiano_twitter> Sorry, I meant the greater scope. My more direct question would be why a regular string wouldn't work for you.
<FromGitter>
<HCLarsen> I don't understand what you mean by that. Who says a regular string wouldn't work for me?
<FromGitter>
<HCLarsen> I already got it working, so a regular string works just fine.
<FromGitter>
<acangiano_twitter> You were asking about mutable strings so I assumed you needed them for some reason. Great that you got it to work. 😊
<FromGitter>
<HCLarsen> Well yeah. Being able to mutate strings is something that comes in handy quite often.
hightower3 has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter>
<HCLarsen> In this case, the difference would have been string.gsub! instead of string = string.gsub. Not a huge deal, but it looks a fair bit cleaner.
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
hightower4 has quit [Ping timeout: 260 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter>
<acangiano_twitter> I hear you. While on the subject of strings a couple more points, in case you haven't looked into them too much. They are heap allocated so somewhat expensive. String.build is worth checking out.
<Papierkorb>
If not on the heap, where else should a run-time built string end up?
<FromGitter>
<acangiano_twitter> I meant that the combo immutable strings and heap allocatoon can get expensive depending on what you are doing.
<Papierkorb>
The crystal ubuntu package should depend on `libxml2`
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
qard has joined #crystal-lang
<qard>
Is there some way to do `with self yield` in an `initialize`?
<qard>
It doesn't seem to work for me.
<Papierkorb>
Yes, just do it. Make sure that `self` is fully initialized though, so all non-nilable @ivars are set
<qard>
The syntax is accepted, but it complains that I gave the initialize a block and the signature doesn't accept it.
<FromGitter>
<r3bo0t> There are many usecases where using DATE type actually helps. Also it restricts people to use crystal-mysql with existing application that handles DATE data type.
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<crisward> @r3bo0t I think I've been using my fork while waiting for this. Not sure why it wasn't merged, I did all the updates per the feedback I think. I have a habit of forking, fixing, using my fork then swapping over when it's merged. Kemal is super quick to merge stuff in, other shards can be a bit slower. Sometimes they have something conflicting going on I know nothing about, but feel free to use my fork while
<FromGitter>
... you wait.
<FromGitter>
<eliasjpr> Is there any way to install shards in a global path?
alex`` has quit [Ping timeout: 255 seconds]
<Papierkorb>
no
<FromGitter>
<eliasjpr> Any plans for that?
<Papierkorb>
who knows
<FromGitter>
<faustinoaq> Maybe using post_install ? or https://github.com/nedpals/sharn, Would be easy to install CLI tools like amber, etc in future
<Papierkorb>
Absolutely not via post_install
<Papierkorb>
If someone messes with anything outside the project using some install hook, they need to be shamed publicly. And their project nuked from the orbit.
<Papierkorb>
faustinoaq, I'm somewhat happy with having a `tool.sh` in bindgen, which you then use like `lib/bingen/tool.sh` from your project root. Works okay-ish I guess. Wouldn't help you to generate applications of course
<FromGitter>
<faustinoaq> Would be interesting to create test like `crystal-ulib` binding `ulib` library, putting crystal at top and showing crystal capabilities of binding C. https://www.techempower.com/benchmarks/previews/round15/
<Papierkorb>
Downside: This requires a `crystal deps` invocation in its post hook
<FromGitter>
<faustinoaq> 👍 ✨ ✨ bindgen and qt.cr are great projects. I wan't able to create a Hackintoch to test it, my pc doesn't have enough memory and space.
<FromGitter>
<faustinoaq> But works excellent on Manjaro Linux 😄
<Papierkorb>
It should work OOTB on "any" linux distro since today, as long you have Qt5.5 (or later) installed
<FromGitter>
<faustinoaq> When Windows support become reality, you would need to create a bat file or a PowerShell script, `tool.ps1` I would help with that 😉
<Papierkorb>
Yeah I'll probably rename tool.sh to just tool, and then have a tool.bat, so both non-win and win users can use the same invocation line in their shell
<Papierkorb>
It's a nice trick Qt uses too to enable everyone to call `./configure` on any OS
<Papierkorb>
Or possibly, wait for someone to contribute a tool.bat. Batch scripts are just out of this universe, and some people think bash scripts are weird
<FromGitter>
<faustinoaq> Yeah, I'm wondering How fast would be programs generated by native Crystal on Windows ?, Linux is often faster
<Papierkorb>
?
<Papierkorb>
as fast as any other native program I guess?
<Papierkorb>
faustinoaq, are you sure that no other software messed with your programs runtime? like anti-virus?
<FromGitter>
<faustinoaq> Yeah, was a bad comment, sometimes I wish Crystal support on Windows too much XD
<Papierkorb>
I'm a bit annoyed though that there seems to be no free service that lets you mess with mac os
<Papierkorb>
the qt stuff should work with some changes though - Depending on how the qt installation was done. iirc, Qt supports a framework and non-framework mode?
<Papierkorb>
work on mac os *
<Papierkorb>
The biggest change would be temporarily commenting the `checks:` in config/find_paths.yml (as those files probably are called differently on mac). Then tell it where to find qmake and it should just generate and build