p0p0pr37 has quit [Read error: Connection reset by peer]
p0p0pr37 has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter>
<codenoid> monday here, and i'm working with crystal <3
martinium has joined #crystal-lang
<FromGitter>
<bararchy> Monday here too ;)
sz0 has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
balduin has quit [Ping timeout: 240 seconds]
<FromGitter>
<bararchy> How can I "tail" a file ? ⏎ Lets say I want to monitor a log file, I always want to read new lines added from the last place I read last time, what logic can I use ? ⏎ Is there some IO trick that does that ?
alex`` has joined #crystal-lang
<FromGitter>
<bew> You'll need sth called inotify I think
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qard has joined #crystal-lang
flaviodesousa has joined #crystal-lang
mark_66 has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
alibby has quit [Quit: Leaving.]
Papierkorb_ has joined #crystal-lang
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<sdogruyol> Have a nice week everyone
rohitpaulk has joined #crystal-lang
ShalokShalom has joined #crystal-lang
<FromGitter>
<Qwerp-Derp> Shouldn't `bsearch` be renamed `search`? The user probably doesn't need to know that it's a binary search, and there's no other function called `search`.
ShalokShalom_ has quit [Ping timeout: 240 seconds]
<Papierkorb_>
Um yes the user needs to know that, as binary search only works on sorted arrays.
<Papierkorb_>
Though #binary_search would be even nicer for a name
rohitpaulk has quit [Ping timeout: 248 seconds]
<Yxhuvud>
yes, and having both #search and #find with different preconditions would not be very nice
rohitpaulk has joined #crystal-lang
<Yxhuvud>
the bsearch name must be a c-through-ruby name inheritance, no?
<Papierkorb_>
oh it's inherited from ruby for sure
faustinoaq has quit [Quit: Konversation terminated!]
faustinoaq has joined #crystal-lang
<FromGitter>
<Qwerp-Derp> Yeah, there's not a function for a default `search`
<FromGitter>
<Qwerp-Derp> Papierkorb_, can't we post an issue to rename `bsearch` and `bsearch_index` to `binary_search` etc.?
<FromGitter>
<Qwerp-Derp> Also why does `delete_at` return the deleted item instead of the changed array?
<Papierkorb_>
because that's more useful?
<FromGitter>
<Qwerp-Derp> ??? How so?
<Papierkorb_>
because you may not know (but want to know) the element you just threw out?
<Papierkorb_>
You have the list already anyway.
<Papierkorb_>
else you couldn't call #delete_at on it
<Yxhuvud>
you already have access to the array as it is modified.
<Yxhuvud>
(and as usual papierkorb is faster. sigh, can my illness go away soon, mkay?)
faustinoaq has quit [Ping timeout: 268 seconds]
faustinoaq has joined #crystal-lang
<FromGitter>
<Qwerp-Derp> Should there be a `#find_index`, since we have `bsearch` and `bsearch_index`? I'm just throwing ideas out there, it's probably a bad idea but eh
Kug3lis has quit [Remote host closed the connection]
Kug3lis has joined #crystal-lang
Bish has joined #crystal-lang
<Kug3lis>
Just finished setting up `The lounge` client its freaking awesome compared to desktop apps ;)
faustinoaq has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
Kug3lis has quit [Remote host closed the connection]
Kug3lis has joined #crystal-lang
Kug3lis has quit [Remote host closed the connection]
Kug3lis has joined #crystal-lang
claudiuinberlin has joined #crystal-lang
fridgerator has joined #crystal-lang
fridgerator has left #crystal-lang [#crystal-lang]
<RX14>
doesn't look better than a normal desktop client to me
<RX14>
the whole web thing is a huge disadvantage
<FromGitter>
<sdogruyol> is there any word on 0.24.1 release?
balduin has joined #crystal-lang
qard has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
<Kug3lis>
RX14 it server its always connected
<Kug3lis>
web is only interface to it
<Kug3lis>
plus it has push notifications and etc so even then browser is closed u will get notified
<Kug3lis>
tab not browser
<RX14>
so it's basically znc + desktop but easier to set up
<crystal-gh>
[crystal] MakeNowJust opened pull request #5288: Fix to parse `"\#{{ ... }}"` inside macro (master...fix/crystal/parse-macro-expression-in-string-follow-hash) https://git.io/vFoBr
qard has quit [Ping timeout: 252 seconds]
<FromGitter>
<Sevensidedmarble> does anyone know how I could convert an array to the type Pointer(Pointer(UInt8)) for passing to a c function?
<RX14>
no because those aren't compatible types
<RX14>
UInt8** i *assume* is an array of strings
<RX14>
but it could easilly not be
<RX14>
C doesn't give you enough info to work that out
<FromGitter>
<Sevensidedmarble> yeah I'm trying to pass stuff directly to LibC.execvp
<RX14>
you'd need to do map(&.to_unsafe).to_unsafe then
<RX14>
why??
<RX14>
there's Process
<RX14>
with exec and run
<FromGitter>
<Sevensidedmarble> yeah I've been trying to get Process.exec to work but I can't format my input correctly. I thought it would want the array of args passed in to start with the name of the command and end with nil, as it would if you just called execvp in c, but that didnt work.
<RX14>
did you read the docs
<FromGitter>
<Sevensidedmarble> Yes
<FromGitter>
<Sevensidedmarble> they dont go into that much detail. they kind of assume you'll want to execute your command in a subshell I think.
<RX14>
does any function in crystal require a nil at the end of the array?
<FromGitter>
<Sevensidedmarble> well no lol
<FromGitter>
<Sevensidedmarble> but thats what argv in execvp expects
<FromGitter>
<Sevensidedmarble> so I just thought I had to
<RX14>
no, of course the stdlib ahndles that for you
<RX14>
it has the array size on hand
<RX14>
the 0 is only there to tell C how long the array is
<RX14>
in crystal arrays store their sizes
<FromGitter>
<Sevensidedmarble> thanks, I haven't done much C
<RX14>
please don't try to call LibC directly if you don't have C experience
<RX14>
it won't end well
<RX14>
what do you want to do with process.exec
<RX14>
as usual this is an xy problem where you've asked me the wrong question and we need to back up a few layers of thought to get to the real question
<FromGitter>
<Sevensidedmarble> I'm trying to call system functions (like ls for example) in my shell, but I dont want it invoking /bin/sh
<RX14>
exec replaces the current process with a new one
<RX14>
it's essentially exit()
<FromGitter>
<Sevensidedmarble> I will thank you. also to clarify though, my issue arises when I pass flags to process.exec. I thought a command like this would work: ⏎ ⏎ ```def ls(string) ⏎ Process.exec "ls -l" ⏎ end``` ⏎ ⏎ but it does not. ls returns "directory not found", as if it interpreted the flag as the directory [https://gitter.im/crystal-lang/crystal?at=5a09b134f257ad91098c1c22]
<FromGitter>
<Sevensidedmarble> and yes, I've run it inside of Fork
<FromGitter>
<Sevensidedmarble> so I'm ok with the process becoming ls
<RX14>
so you now want Process.run
<RX14>
we already do the fork (properly) internally in Process.run
<RX14>
you do not want to do it manually
<RX14>
Process.run("ls", ["-l"]) should work
<RX14>
and Process.run("ls -l", shell: true) should work
<RX14>
and even Process.run("ls -l") might do the splitting for you
<RX14>
nope
<RX14>
you need to split manually, or get a shell to do it for you
<RX14>
which one is up to you
<RX14>
you can make the shell die right after splitting using shell exec
<RX14>
Process.run("exec ls -l", shell: true) will make the slell run ls but replace the shell with the ls process
<RX14>
but thats usually not necesary
<FromGitter>
<Sevensidedmarble> it seems to run but I dont get its output
<FromGitter>
<Sevensidedmarble> do I have to specify I want its output to STDOUT?
<RX14>
where do you want it's output?
<FromGitter>
<Sevensidedmarble> to the screen
<RX14>
do you want stderr roo?
<RX14>
too*
<FromGitter>
<Sevensidedmarble> for this command I don't think I need it but I'm sure I will eventually
<FromGitter>
<Sevensidedmarble> also Process.run only invokes /bin/sh if you pass shell=true correct?
<RX14>
you want to use output: Process::Redirect::Inherit
<RX14>
and the same for error
<RX14>
I thought that the Process documentation was more complete
<RX14>
but it seems it's still terrible
<FromGitter>
<Sevensidedmarble> its pretty slim yeah
<FromGitter>
<Sevensidedmarble> I don't see anything on the Process:Redirect::Inherit thing either
<FromGitter>
<Sevensidedmarble> where do I pass that in to run?
<RX14>
in 0.24.0 it'll be s/true/Process::Redirect::Inherit/g
<Papierkorb_>
Why? :|
<RX14>
it's more descriptive
<RX14>
having weird values is... weird
<Papierkorb_>
`true` is convenient and what you usually want anyway
<RX14>
do you know what would be more convenient?
<FromGitter>
<Sevensidedmarble> well it did work lol
<RX14>
enum shorthand
<RX14>
and it would be the best of both worlds
<FromGitter>
<Sevensidedmarble> yeah I wish the docs said a little bit more about process handling
<FromGitter>
<Sevensidedmarble> on one hand I guess I get that its something that you probably shouldnt try if you dont know much about, but Id really like to learn as much as I can
<Papierkorb_>
There's no "security by obscurity", including in docs
<FromGitter>
<Sevensidedmarble> but about the subshell thing, it only invokes /bin/sh if you pass shell=true right?
<Papierkorb_>
Yes
<FromGitter>
<Sevensidedmarble> ok thank you
<FromGitter>
<Sevensidedmarble> just want to make sure because it kind of defeats the purpose of my project to just keep calling sh lol
<Papierkorb_>
But as you're building a shell, splitting would be your job
<FromGitter>
<Sevensidedmarble> yeah
<Papierkorb_>
Not because to do work on your end, but because of the flexibility it comes with
<FromGitter>
<Sevensidedmarble> how do you mean?
hightower2 has quit [Ping timeout: 248 seconds]
<FromGitter>
<Sevensidedmarble> also thank you a ton for the help @RX14
<FromGitter>
<Sevensidedmarble> theres a basic syntax for parameter expansion yeah
<FromGitter>
<Sevensidedmarble> but as I understand it its much simpler then what shells like zsh do
<FromGitter>
<Sevensidedmarble> they have complex rules for all this expansion stuff
<Papierkorb_>
Because it's ridiculously helpful
<FromGitter>
<Sevensidedmarble> "Other shells, such as zsh, provide a rich glob syntax for restricting the files matched by globs. For example, **(.), to only match regular files. Fish prefers to defer such features to programs, such as find, rather than reinventing the wheel. Thus, if you want to limit the wildcard expansion to just regular files the fish approach is to define and use a function."
<Papierkorb_>
no need to learn find or some other random tool.
<Papierkorb_>
zsh got it covered
<RX14>
or just learn find
<Papierkorb_>
ok. another reason for me to not use fish.
<FromGitter>
<Sevensidedmarble> lol
<RX14>
and use it everywhere
<RX14>
instead of learn zsh and use it only on your desktop
<RX14>
because you don't see me provisioning servers with zsh
<Papierkorb_>
k
<FromGitter>
<Sevensidedmarble> I love fish but I do disagree with a lot of their designs. for example being needlessly different when it comes to using "command1; and command2" vs "command1; command2"
<RX14>
i use zsh for the completion and the prompt
<RX14>
globbing... meh
<Papierkorb_>
those parts can be done in plain bash for the most part
<FromGitter>
<Sevensidedmarble> I definitely need to learn more about globbing in zsh though
<FromGitter>
<Sevensidedmarble> also the backtick method in crystal invoke system() correct?
<RX14>
which invokes Process
<RX14>
it probably just uses Process directly
<RX14>
iirc ` has some differing semantics
<RX14>
but it's all just wrappers over Process
<FromGitter>
<Sevensidedmarble> well it returns the result of the commands output which is nice
<FromGitter>
<Sevensidedmarble> but does it invoke bin/sh?
<Papierkorb_>
it's a short-hand, ported over from ruby
<Papierkorb_>
Yes
<FromGitter>
<Sevensidedmarble> well with what I've learned about process.run so far it seems like it cant be too hard to write the output to a temporary filedescriptor to read from
<FromGitter>
<Sevensidedmarble> unless theres a simpler way
<Papierkorb_>
why do you want to capture the output? implementing a sub-shell feature?
<FromGitter>
<Sevensidedmarble> yes, like bashs $(subcommand)
<FromGitter>
<Sevensidedmarble> does that actually invoke sh in bash and zsh?
<Papierkorb_>
what shells probably do is fork() away, reconnect their stdout to an IO pipe, and then invoke the command like normal
<FromGitter>
<maiha> @Sevensidedmarble `Shell::Seq` might help you. That's simple and handy and powerful for using stdout, stderr, and both easily. ⏎ https://github.com/maiha/shell.cr
<Papierkorb_>
Using plain Process for that would work, until you want to use everything but non-trivial (for the shell) operations in the sub-shell
<RX14>
@Sevensidedmarble you can pass any IO (i.e. MemoryIO or String::Builder) to the output param and that captures stdout
<FromGitter>
<Sevensidedmarble> huh that does look helpful
<FromGitter>
<Sevensidedmarble> oh really
<FromGitter>
<Sevensidedmarble> wow
<RX14>
click the "Stdio" link in the docs
<FromGitter>
<Sevensidedmarble> I didnt know String::Builder could do that...
<RX14>
and it had docs on what you can pass to input/output/error params
<FromGitter>
<Sevensidedmarble> that is amazing
<FromGitter>
<Sevensidedmarble> that would be a very nice way to get the output back for subshell commands
<RX14>
yes
<RX14>
no need to fork lol
<RX14>
we have fibers and evented IO
<FromGitter>
<Sevensidedmarble> thats so fucking cool
<RX14>
Process can do pretty much everything you ever want regarding processes
<FromGitter>
<Sevensidedmarble> it looks like according to the bash docs when you use subshells in bash it starts a whole new bash process for that input
<Papierkorb_>
Yes, as I said, traditional shells fork
<RX14>
yeah but thats not really neccesary I think
<FromGitter>
<Sevensidedmarble> I guess that makes sense since you can put anything you can in bash into the subshell
<Papierkorb_>
As it should be
<RX14>
you can do the same in 1 process
<Papierkorb_>
With careful design, you can make do without forks
<RX14>
it's just seperating your entire shell into a pluggable function call
<RX14>
and then using fibers
<Papierkorb_>
But, protip: Don't just write code, think about the architecture first.
<RX14>
and you should be able to replicate it without fork
<RX14>
exactly
<FromGitter>
<Sevensidedmarble> this has helped me a lot and given me a lot to think about thank you
<Papierkorb_>
Sevensidedmarble, I don't even mean "model classes and their functions". Neither do I mean UML. Just the general architecture first. It may help if you write empty modules to get a feel for the general structure of your code. Maybe empty classes too. That's a personal thing what actually helps though. If you never did it, try it
<FromGitter>
<Sevensidedmarble> I always kick myself down the road for not writing like that.
<RX14>
just a quick think in your head is often enough for small tasks
<RX14>
don't get too tied down in design
<FromGitter>
<Sevensidedmarble> I always just writing something horribly imperative and spaghetti and then at some point refactor it
<RX14>
it's going to change anyway
<RX14>
but you should think for 5 minutes:
<Papierkorb_>
You already know what features you want to support (Maybe not exactly what, but the general functionality like "sub shells" or "pipes"). The arch should be capable of doing all these without hacks.
<RX14>
1) what are the functions this needs to have
<RX14>
2) what problems will I encounter when implementing those functions
<RX14>
3) how will I design my program to make those problems easier to solve
<RX14>
in this case, subshells mean abstracting your interface so that you can run many shells inside 1 program
<RX14>
really, you should make that possible *regardless* for specs
<FromGitter>
<Sevensidedmarble> I think it should be possible the way things are structured now with just a little tweaking
<FromGitter>
<Sevensidedmarble> right now the program always enters the interactive loop, and I haven't added the -c option
<RX14>
for me i'd think, encapsulate one shell process in 1 class with no global state
rohitpaulk has quit [Ping timeout: 248 seconds]
<Papierkorb_>
ENV is global state too
<RX14>
^
<RX14>
good point
<RX14>
env should be a property of the class, obviously read from ENV at the root shell
<Papierkorb_>
And is actually relevant to get right to write commands like `VERBOSE=1 make`
<FromGitter>
<Sevensidedmarble> that seems pretty necessary though
<RX14>
yep Papierkorb_
<Papierkorb_>
You can #to_h ENV to copy it
<RX14>
i get the feeling few people know about prefix-env notation based on how many people use it
<RX14>
and i get sad
<Papierkorb_>
Their loss
<RX14>
ikr
<FromGitter>
<Sevensidedmarble> what syntax is that?
<Papierkorb_>
talking bout the devil
<Papierkorb_>
It temporarily exports the variable pair for the runtime of the command
<RX14>
it's the same as env FOO=bar make
<Papierkorb_>
Or rather, exports it only in that command
<RX14>
lol
<RX14>
if you know about the env command
<FromGitter>
<Sevensidedmarble> huh yeah I think I've seen that when trying to compile luajit
balduin has quit [Ping timeout: 248 seconds]
<FromGitter>
<Sevensidedmarble> or luarocks
rohitpaulk has joined #crystal-lang
<FromGitter>
<ethagnawl> I just made a small donation on Bountysource. As such, can I bump the Pi support issue?
<RX14>
what do you mean the pi support issue? we already run on arm
rohitpaulk has quit [Ping timeout: 260 seconds]
robacarp has quit [Quit: robacarp]
Bish has quit [Ping timeout: 248 seconds]
Bish has joined #crystal-lang
Papierkorb_ has quit [Quit: Konversation terminated!]
<FromGitter>
<ethagnawl> AFAIK, there's no available binary package for Raspian.
<RX14>
im sure it must have been posted in whatever issue you have seen
<FromGitter>
<ethagnawl> I've commented about that option in this channel before: there appears to be a problem with the associated GPG key/s
<FromGitter>
<ethagnawl> I've emailed Julien about it and never heard anything back (which is completely fine). That's part of the reason I was bumping the issue.
robacarp has joined #crystal-lang
<FromGitter>
<ethagnawl> > W: GPG error: http://public.portalier.com raspbian/ Release: The following signatures were invalid: BADSIG D5581943005FAF9E Portalier Julien (Debian Packages Sign Key) <julien@portalier.com>
<FromGitter>
<ethagnawl> Also, looking back over our exchange, I should have said, "there's no official binary package for Raspian"
mark_66 has quit [Remote host closed the connection]
snsei has quit [Remote host closed the connection]
hightower4 has joined #crystal-lang
hightower3 has quit [Ping timeout: 248 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
vivus has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<watzon>
Anyone here C/C++ guys. I have a guy that's ripping on Crystal and is one of those "C++ is the God language and all others suck" kind of guys
<watzon>
He doesn't seem to believe there are people in the Crystal community that know C/C++ lol
rohitpaulk has quit [Ping timeout: 268 seconds]
<Papierkorb>
watzon: Can't write a binding generator without knowing the target and source languages
qard has joined #crystal-lang
<watzon>
I figured you were a C guy papierkorb haha
jaitaiwan has quit [Ping timeout: 240 seconds]
jaitaiwan has joined #crystal-lang
<Papierkorb>
C/C++, used both. Good languages.
<FromGitter>
<sdogruyol> @Papierkorb what do you actually think about Crystal?
<Papierkorb>
in which sense?
<FromGitter>
<sdogruyol> as a language
<FromGitter>
<sdogruyol> good / bad e.g
<FromGitter>
<sdogruyol> first time seeing you calling a good language :P
<Papierkorb>
Well if I think Crystal would be awful I would've left immediately. (I actually have a list of language features I want, and some more practical questions)
<Papierkorb>
There are a ton of things wrong. Language-design wise, not that much actually. Not much that's unfixable at that I guess.
<FromGitter>
<sdogruyol> so, you call it "not awful".
<FromGitter>
<sdogruyol> :P
<Papierkorb>
Well that question can't be answered. Good in which sense?
<Papierkorb>
Would I build an OS kernel in it? Nah (I actually verified this by trying, as I was curious)
<Papierkorb>
The I/O design is great. It feels a bit weird at first that you write blocking code, which isn't actually blocking at all. So that's great.
<Papierkorb>
This is actually HUUUUGEE
<FromGitter>
<marksiemers> If you had to choose one language to do over 50% of your projects/work in, would it be crystal?
<FromGitter>
<sdogruyol> I'm not sure in which sense, since you're the one who called C/C++ a "good language". I was just curious if Crystal is in the same league for you :P
<Papierkorb>
Because you can, basically, use any given Crystal-only shard, throw it in your app, and you know that it won't block your thread. How fantastic is this?! In C++, this is only true for Qt-based libs. Other languages, including Rust, don't have this.
<FromGitter>
<sdogruyol> @marksiemers yes, after 1.0 that ratio will go higher for sure
<Papierkorb>
Even the league question can't be answered
<Papierkorb>
C/C++ have some wonky bits (Especially C++, oh my god). But then, they're really old. C was built for system development. Which it's really good at (Surprise!)
<Papierkorb>
C begins to be annoying when doing GUI things. It's bearable, Gtk+ does a good job overall. But really, compared to other solutions, it's just not that good for that.
<FromGitter>
<sdogruyol> We're not emphasizing non-blocking IO, they've marketed Node.js with this (excluding the JS part)
<Papierkorb>
C++ takes over at that point IMHO
<Papierkorb>
JS is just uargh
<Papierkorb>
JS ES6 was a huge improvement
<Papierkorb>
still not great, but so much better
<FromGitter>
<marksiemers> For non-computer scientists (web developers, data scientists, hackers), the language is amazing. The fact that you can get the benefits of static typing without having to worry about it all the time, but then you can opt in to being explicit in your method definitions. ⏎ As time goes on, there are just going to be more and more people where coding is just part of their job - crystal is well positioned for
<FromGitter>
... that.
<FromGitter>
<sdogruyol> they've marketed an unbearable language with non-blocking IO back in 2010...
<Papierkorb>
But I wouldn't take a JS dev job :)
<FromGitter>
<sdogruyol> @marksiemers may I ask what do you use for your work?
<Papierkorb>
sdogruyol, the issue is that their non-blocking model is just crap
<FromGitter>
<sdogruyol> @Papierkorb noone should
<Papierkorb>
Callback hell is real
<Papierkorb>
That's just shit
<FromGitter>
<sdogruyol> yeah, but still it's already there, it's real
<FromGitter>
<marksiemers> I still don't understand how such a terrible language (JS) got to where it is today. I blame Andreesen in the 90's and the IE team after him for not creating a suitable replacement.
<Papierkorb>
And I come from Qt, where you got around this (Signals/Slots are kinda callbacks, no?) because the overall design was so much better. Not perfect, but it does a good job.
<Papierkorb>
Oh yeah, Crystals main thing, really the number one feature, is: The type system
<FromGitter>
<marksiemers> @sdogruyol - I have quite a varied career so far (programming, running a window cleaning business, etc.). ⏎ Tech-wise, I spent two years coding a combo of SQL Server stored procs, C#, JavaScript (not for web, but a proprietary front-end), C and C++, and even FORTRAN 77 ⏎ But more recently, I've been a ruby-ist
<Papierkorb>
It's the best thing since sliced bread. It runs circles around a proper non-blocking IO model.
<Papierkorb>
Which is btw why I'm kinda clear in wording when it comes to making changes to the type system.
<Papierkorb>
As in: Break the type system, and I'm off.
<Papierkorb>
It's statically typed, benefits of .. static languages. But you don't have to "think" about it, which is the part where Crystal is suddenly superior to C++ IMHO
<FromGitter>
<unreadable> > **<Papierkorb>** But I wouldn't take a JS dev job :)
<FromGitter>
<unreadable> why not?
<FromGitter>
<unreadable> easy languge, very well payed
<FromGitter>
<unreadable> It has its bad parts, but overall es6 made it to great
<FromGitter>
<unreadable> so*
<Papierkorb>
And as the type system is like 80% of language design (From what I see), this is actually a thing to consider for C++ people to try Crystal
<Papierkorb>
JS?!
<Papierkorb>
The standard library is pure garbage
<Papierkorb>
It's not .. what I have in mind, when I think of OOP either.
<Papierkorb>
Micro library hell. Just no.
<Papierkorb>
leftpad.js
<Papierkorb>
you gotta be kiddin me
<FromGitter>
<marksiemers> @unreadable - ES6 is nice, but that you have to worry about all that transpiling and a build process for browser support. And if you are writing backend stuff, dealing with it being non-blocking can be a pain
<FromGitter>
<marksiemers> plus `node_modules` - the 7th level of hell
<Papierkorb>
ES6 e.g. finally has a Array forEach. Kinda nice. Except that many things aren't actually arrays. So no forEach. This is huge
<Papierkorb>
Now I have the full disvantage of a dynamic typed language
<FromGitter>
<unreadable> I don't think there's a standard lib in plain js oo
<Papierkorb>
With no benefit
<FromGitter>
<sdogruyol> @marksiemers wow, that's really interesting career you have :)
<Papierkorb>
E.g. in Ruby, you have #each. Usually, this means it's an Enumerble. If not, I can do `foo.each.something_enumerable` (never needed inside the stdlib)
<Papierkorb>
unreadable, on top of that, I really don't want to get into webdev
<FromGitter>
<marksiemers> Yeah, and I was most recently a bootcamp teacher, but my company is shutting down, so I'm currently funemployed (hence my time to spend on OSS). ⏎ You wouldn't believe what led me to contribute to amber.
<FromGitter>
<marksiemers> It would be greatly appreciated
<FromGitter>
<unreadable> > **<Papierkorb>** Callback hell is real
<FromGitter>
<unreadable> callback hell is history
<Papierkorb>
now you have then hell
<Papierkorb>
That's crap too
<Papierkorb>
Promises are the answer to the wrongly posed problem
<FromGitter>
<unreadable> > **<Papierkorb>** now you have then hell
<FromGitter>
<unreadable> async/awayt
<FromGitter>
<unreadable> and the .then hell is very readable
<Papierkorb>
C is readable too
<Papierkorb>
A wrong solution may be readable, still makes it a wrong solution
<FromGitter>
<unreadable> I'm not taking Js part, but it changed so much in a good way
<Papierkorb>
honestly, async IO is so fundamental, it needs to be taken care of either in the stdlib, OR in a defacto standard library everyone uses
<FromGitter>
<unreadable> I've had a webdev job, but got bored after some time, would love to work with compiled languages that doesn't have to deal with frontend and stuffs like that
<Papierkorb>
The issue is that you again and again solve the same issue. Even if it's only a .then away. Or an await keyword (Though this is much more acceptable than promises)
<FromGitter>
<unreadable> aren't both node and crystal based on the same `libuv` library for handling concurency?
<Papierkorb>
no, Crystal uses libevent
<FromGitter>
<unreadable> misunderstood
<FromGitter>
<bararchy> Papierkorb AFAIK Linux does not have a real AsyncIO, this is why you need to use non-blocking to achive the same effect
<FromGitter>
<bararchy> this is indeed where Crystal shines
<Papierkorb>
bararchy, of course
<Papierkorb>
Though that's fine (There are other parts that create actual issues)
<FromGitter>
<unreadable> but honestly `call(func(data, err) { if err ... }` seems better than `data, err := fetch(..); if err != nil { .. }`
<FromGitter>
<bararchy> I had a big argument with a Windows C# dev, who was like "dude you need Async" dont use nonblocking, and I was like "there is no Async on Linux" ...
<FromGitter>
<bararchy> it was a stupid debate :\
<Papierkorb>
Is there 'real' async IO on windows in the WinAPI?
<FromGitter>
<bararchy> yeha
<FromGitter>
<bararchy> using "tasks" or .. "jobs" I can't remember how they call it
<FromGitter>
<bararchy> it does not really matter though, as non-blocking does exactly the same functionality wise
<FromGitter>
<bararchy> when you know how to use it
<Papierkorb>
sdogruyol, in the end, I have a pretty clear opinion on things. However, these are purely subjective. I hate Java. I'd probably still use Java if a bank would tell me to build something for them. (And the JVM is actually not even the reason here for once!)
<FromGitter>
<sdogruyol> same
<FromGitter>
<sdogruyol> pays the bills
<Papierkorb>
Oh no, even if the bank would tell me "choose, Ruby or Java?" I'd go with Java
<Papierkorb>
(Nothing wrong with ruby, I still use it, and Roda+Sequel is the best webdev combo there is)
<FromGitter>
<unreadable> is it possible in crystal to set garbage collection target percentage?
<Papierkorb>
So, erm, for the off chance that someone knows: Anyone in here with knowledge on ARM TrustZone?
<Papierkorb>
unreadable, check BoehmGC for possible configuration options
<FromGitter>
<unreadable> ok
claudiuinberlin has joined #crystal-lang
foca_ has joined #crystal-lang
foca has quit [Ping timeout: 255 seconds]
olbat[m] has quit [Ping timeout: 255 seconds]
woodruffw has quit [Ping timeout: 255 seconds]
foca_ is now known as foca
woodruffw has joined #crystal-lang
woodruffw has joined #crystal-lang
handicraftsman has quit [Ping timeout: 240 seconds]
handicraftsman has joined #crystal-lang
weston_[m] has quit [Ping timeout: 240 seconds]
thelonelyghost has quit [Ping timeout: 240 seconds]
byteflame has quit [Ping timeout: 250 seconds]
tybee[m] has quit [Ping timeout: 250 seconds]
cptaffe has quit [Ping timeout: 264 seconds]
sija[m] has quit [Ping timeout: 240 seconds]
watzon has quit [Ping timeout: 248 seconds]
TheGillies has quit [Ping timeout: 248 seconds]
kp666[m] has quit [Ping timeout: 255 seconds]
dtcristo has quit [Ping timeout: 250 seconds]
braidn[m] has quit [Ping timeout: 264 seconds]
Renich has quit [Ping timeout: 264 seconds]
<FromGitter>
<mswieboda> hey all new here, had an issue I reached out to oprypin, and he directed me here. For CrSFML install following https://github.com/oprypin/crsfml#approach-1 via Mac Homebrew, I'm using `asdf` for crystal installation, crystal ver 0.22.0, It looked like the VoidCFML bins installed etc, but I'm not 100% anyways here's the issue in the terminal: ⏎ ⏎ `````` [https://gitt
<FromGitter>
<Fryguy> that seems ok to me...I rarely build things and don't put them in /usr/local/lib or wherever though, so there might be edge things I don't recognize
<RX14>
looks like it should work to me from a linux standpoint
<FromGitter>
<mswieboda> k, well hmm, just wanna do 2D gaming in Crystal, thought this'd be a killer start
<RX14>
and I doubt oprypin uses osx either
<FromGitter>
<mswieboda> yeah, i'm on a Mac
<FromGitter>
<mswieboda> k
<RX14>
"New versions of OS X enable system integrity protection per default. Meaning that setting the DYLD_LIBRARY_PATH and LD_LIBRARY_PATH will have no effects."
<FromGitter>
<mswieboda> np, all my linux's are kinda trashed right now. I may be able to do it, but haven't gotten crystal on there yet
<FromGitter>
<mswieboda> ahh good find
<RX14>
use linux
<RX14>
:)
<FromGitter>
<Fryguy> I'm on mac too...I can give it a shot later tonight
<FromGitter>
<mswieboda> hahah
<FromGitter>
<Fryguy> ah yeah, try setting DYLD_LIBRARY_PATH as well
<FromGitter>
<mswieboda> okay to the same thing? `export DYLD_LIBRARY_PATH="$LIBRARY_PATH"` I'm assuming?
<RX14>
i guess
<FromGitter>
<mswieboda> nope, same thing, but good guess.
<RX14>
what is which ld and which cc
<FromGitter>
<mswieboda> repeat in less linuxy jargen? `$ which ld` ?
<FromGitter>
<mswieboda> yes, for sure. some ppl are assholes
<FromGitter>
<mswieboda> i used to teach Rails at a Women only invite thingy for them to learn, it was really cool
<FromGitter>
<mswieboda> anyways, thx for ur help, person of earth, dust and bones, and hopefully some muscle and skin too. I'mna go to a Chicago museum before it closes. So later, and thanks again! Go crystal, #HUUUUGE_PHAN
<FromGitter>
<mswieboda> ;)
Ven has joined #crystal-lang
Ven is now known as Guest78171
braidn[m] has joined #crystal-lang
byteflame has joined #crystal-lang
Renich has joined #crystal-lang
tybee[m] has joined #crystal-lang
TheGillies has joined #crystal-lang
kp666[m] has joined #crystal-lang
dtcristo has joined #crystal-lang
cptaffe has joined #crystal-lang
thelonelyghost has joined #crystal-lang
watzon has joined #crystal-lang
weston_[m] has joined #crystal-lang
sija[m] has joined #crystal-lang
Guest78171 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]