<FromGitter>
<elorest> <oprypin> How would I save the binary value for a char and add that to an io which I would convert back to a string at the end? https://carc.in/#/r/2d0w
<FromGitter>
<elorest> Currently it’s storing the binary values of the numbers it seems. It’s there some sort of way to store a single byte as a value?
<FromGitter>
<elorest> In c++ and java I can cast and unsigned integer to a byte.
Guest24175 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<johnjansen> a char is 2 bytes
<FromGitter>
<elorest> most chars are only one byte. in utf8 they can be up to 4 though.
<FromGitter>
<elorest> Yeah. I’m not really sure why they treat the string differently though… it makes the ruby implementation look harder to read than the java one for some reason.
<FromGitter>
<elorest> Not very dry.
<FromGitter>
<elorest> I still spend about 30 minutes trying to get the ruby version to compile in crystal. Got some weird errors and eventually just decided look at the working java one and go from there.
<FromGitter>
<elorest> Idk I’ve been writing ruby for 12 years and typically ruby shouldn’t follow this pattern.
<FromGitter>
<elorest> Probably is I’ve worked with bytes in c and java 10+ years ago but never really in ruby… so now trying to do it in crystal is confusing because bytes are just uint8 instead of byte and I’m not quite sure how to differentiate them.
<FromGitter>
<johnjansen> since ive been in the land of crystal ive discovered a plethora of code that returns multiple types, relies on the inherent stringiness in ruby and many other sins … im kind of disappointed
<FromGitter>
<elorest> Sure in regard to bytes definitely… the way it pretty much does the same thing twice for 2 different data types seems weird. Even in ruby they should just take the string and split it up into bytes and encode it instead of looking for string or array or bytes.
<FromGitter>
<elorest> The second part of their block doesn’t even work… But mine doesn’t work at all for now! :(
<FromGitter>
<elorest> It does return a value. It’s just wrong.
<FromGitter>
<johnjansen> this looks like alot of fun to debug … but alas i decided to clean the garage, and now it looks like a bomb went off … so id better do that before i get in trouble
greengriminal has joined #crystal-lang
<FromGitter>
<johnjansen> 2 things jump out at me … 1, it starts with the correct letter and 2, its 1 char short
<FromGitter>
<johnjansen> long
<FromGitter>
<johnjansen> doesnt it use pairs of chars?
<FromGitter>
<johnjansen> if so why does your have an odd number
<FromGitter>
<bararchy> ^ yeha , best place is the shards.xyz
<FromGitter>
<distinct> love it
greengriminal has quit [Quit: This computer has gone to sleep]
<oprypin>
elorest, sorry, you understood me as the opposite of what i meant. if i wasnt on mobile i would've just fixed it
<oprypin>
carc.in on mobile... lives up to its name
<FromGitter>
<elorest> <oprypin> I think I figured that out eventually. Still doesn’t work though. by default these crystal uses int32. I believe that should be more than enough space to fit everything. https://carc.in/#/r/2d3v
<FromGitter>
<elorest> copy it to the empty repo you’ve cloned.
<FromGitter>
<LuckyChicken91_twitter> the .git folder?
<FromGitter>
<elorest> no. the folder that contains the .git folder
<FromGitter>
<LuckyChicken91_twitter> but then im just cloning the crplus folder into the crplus folder
<FromGitter>
<elorest> You’ve already cloned the folder. Now copy your code into the folder and add, commit and push it up to github.
<FromGitter>
<elorest> don’t clone it again
balduin has quit [Ping timeout: 268 seconds]
<FromGitter>
<LuckyChicken91_twitter> wait wait wait.. im having the crplus folder. And now i should copy the code in the src folder again into the crplus folder?
<FromGitter>
<LuckyChicken91_twitter> yeaah my shard is working now
<FromGitter>
<LuckyChicken91_twitter> sorry for being a little bit annoying @elorest
<Groogy>
Morning
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
<Groogy>
Hmm can I somehow provide a type to a method that would tell it "I want you to build an object of this type"
<hightower3>
Groogy, you can pass a type, and do variable.new() later
<Groogy>
thx
<FromGitter>
<LuckyChicken91_twitter> can someone tell me how the crystal language was made? because 98.1% is already maked with crystal.. this makes somehow no sense
<Nouv>
It's self hosted
<Nouv>
Crystal is able to compile itself
<Nouv>
It was initially written in Ruby
<FromGitter>
<LuckyChicken91_twitter> in RUBY?
<FromGitter>
<LuckyChicken91_twitter> wut
<Nouv>
Yes.
<FromGitter>
<LuckyChicken91_twitter> but how can it then be so fast?
<Groogy>
a compiler is just a glorified text reader that turns text into machine code, you could probably make a compiler in Brainfuck if you really hate yourself enough
<FromGitter>
<LuckyChicken91_twitter> i know
<Nouv>
Lucky: Initially it wasn't
<Nouv>
when the compiler was written in Ruby it was slow
<Nouv>
But self hosting itself, Crystal was able to compile fast
<FromGitter>
<LuckyChicken91_twitter> hm. Really strange. well the main thing is that it works.
<Groogy>
Clang and GCC is written in C/C++ isn't it?
<FromGitter>
<LuckyChicken91_twitter> the people are saying theres no gui framework yet. But theres one. crsfml
<Groogy>
CrSFML doesn't do what's normally termed GUI
<oprypin>
LuckyChicken91_twitter, it does not allow you to put any native OS controls, even a simple button takes some effort. it's just graphics display and event handling
<Groogy>
SFML is a multimedia library/framework
<FromGitter>
<LuckyChicken91_twitter> hm
<FromGitter>
<LuckyChicken91_twitter> but its a beginning
Ven has joined #crystal-lang
Ven is now known as Guest52311
<hightower3>
Lol I just got error "named tuple too big"
kubaxvx__ has quit [Read error: Connection reset by peer]
<oprypin>
D: i'm actually really curious what you were doing
<FromGitter>
<drosehn> `@method`-variables are variables that exist in instances of a class, which means they have to be defined inside a `class Blah` ... `end` section. And those variables are in an *instance* of a class, which means the program would need to do a `save_inst = Blah.new` to create an instance of that class.
<FromGitter>
<LuckyChicken91_twitter> i know
<FromGitter>
<LuckyChicken91_twitter> but i would find it better if you can define @method_variables too in top level like in ruby
<FromGitter>
<drosehn> You could avoid that by using `@@class` variables, and then wrapping all your methods inside of a `module`. This is kind of an odd reason to use a module, but it can be used to have the effect that I think you want.
<FromGitter>
<drosehn> It was an explicit decision in the design of crystal that it would not support `@instance` variables at the top level like ruby does. And a similar decision was that crystal would not support `$global` variables in the way that ruby does.
<FromGitter>
<drosehn> Well, it has some compiler-defined `$global`-variables, but does not allow users to create their own new `$variables`. Earlier versions of crystal *did* support user-defined `$global` variables, but it was decided that the crystal language would be better if it did not allow that.
rohitpaulk has joined #crystal-lang
<oprypin>
$ does not stand for global
<oprypin>
and yeah masking globals as variables of meaningless classes is so much better /s
Guest52311 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven has quit [Client Quit]
<oprypin>
it's actually a difficult to find any information on what $ means
<oprypin>
so i guess $~, $1, $2, $... are variables that can leak to the caller's scope
<FromGitter>
<drosehn> I just used the `$global` and `$variables` because `$` is the prefix-character used to denote them in a few languages, including ruby.
<FromGitter>
<drosehn> Well, the remaining `$-variables` in crystal are globally-defined "special variables" that the compiler controls.
<FromGitter>
<drosehn> or maybe "provides and controls".
<oprypin>
ah no, only $~ is a variable that can leak to the outer scope
<oprypin>
$1 is an alias to $~[1].not_nil!
<FromGitter>
<drosehn> Hmm. I'm not completely sure that `$~` will always leak to an outer scope, although I tend to program as if it did. so if it does, then I wouldn't notice it...
<FromGitter>
<drosehn> Yeah, that's the kind of example I was wondering about. I knew `$~` leaked to outer scopes in some situations, but I wasn't sure it would leak to all outer scopes.
<oprypin>
just one level
<FromGitter>
<drosehn> Well, `$0` exists in many languages (including shells), and I expect it doesn't hurt anything to keep it in crystal. ("keep" in the sense that crystal used to have all the same `$global`-variable support that ruby has, but then removed almost all of that, except for the few things it "kept").
<oprypin>
that's not a valid justification
<FromGitter>
<drosehn> If `$0` was removed, then crystal would just have to add some other way to get the same value. It seems to me that wouldn't be much of a win.
<FromGitter>
<LuckyChicken91_twitter> how can I rescue "undefined method" errors?
<oprypin>
$0 is unconditionally rewritten to PROGRAM_NAME
<FromGitter>
<drosehn> Well, I'm not a designer of the language. I just dabble with it when I have the time. But I'm happy that they kept `$0`.
<oprypin>
LuckyChicken91_twitter, these errors happen at compilation, the program never runs
<oprypin>
LuckyChicken91_twitter, try running `crystal build program_name.cr` and you'll see the error - these errors you can't catch, you need to fix your program
<FromGitter>
<drosehn> ... and since the program never runs, it is impossible for the program to trap them.
<FromGitter>
<LuckyChicken91_twitter> this error is wanted!
<FromGitter>
<LuckyChicken91_twitter> i want to rescue it with begin,rescue,end
<FromGitter>
<drosehn> It isn't wanted by crystal ! 😄
<FromGitter>
<LuckyChicken91_twitter> ugh
<oprypin>
sigh
<oprypin>
>> "a" =~ /a/; p $0
<DeBot>
oprypin: "/home/crystal/.cache/crystal/crystal-run-eval.tmp" - more at https://carc.in/#/r/2d62
<FromGitter>
<LuckyChicken91_twitter> but wait.. theres ```$0``` ?! then crystal lied to me! crystal said "$global_variables are not supported, use @@class_variables instead"
<oprypin>
it's not a global variable
<oprypin>
just a silly special construct that starts with '$' and is unconditionally rewritten to PROGRAM_NAME
<FromGitter>
<LuckyChicken91_twitter> its a special super indefinable variable?
<FromGitter>
<drosehn> Well, for one thing, it's a global CONSTANT. The program cannot change the value. (although it looks like crystal does not complain about `$0 = "some string"`, but executing that does not change the value of `$0`).
<oprypin>
sorry, that action is not accessible from gitter
<oprypin>
drosehn, when you write $0 = blah, it's rewritten to PROGRAM_NAME = blah causing the error indirectly
<oprypin>
anyway, the main point is $0 does makes sense in shells, but the shells also have $1, $2, $@ to get access to all arguments
<FromGitter>
<drosehn> Well, I happened to pick an interesting test for this. I added the lines to the test-module program I had, and in that it does not error at all.
<oprypin>
$0 is just the first argument passed to the program, a logical continuation of $1, $2 and all
<oprypin>
and it went sh -> perl -> ruby -> crystal and ended up making absolutely no sense
<oprypin>
because all other of these constructs have been replaced with something that makes sense
<oprypin>
and also shells use $1 at every level, for function arguments if it's inside a function
<FromGitter>
<LuckyChicken91_twitter> im using windows
<FromGitter>
<LuckyChicken91_twitter> but he shows me linux
<FromGitter>
<LuckyChicken91_twitter> but its just the linux subsystem
<FromGitter>
<straight-shoota> So it's technically linux (inside windows)
<FromGitter>
<straight-shoota> there is no direct way for crystal (or any application for that matter) to know this
<FromGitter>
<straight-shoota> The os flags are known at compile time. If you want more details about the operating system like which linux distribution, you need to specifically ask the operating system
<FromGitter>
<straight-shoota> For linux, this information would be provided for example by `lsb_release`
Elenian has joined #crystal-lang
<oprypin>
not on ancient still supported redhats though xD
<FromGitter>
<straight-shoota> *most linux :D
<FromGitter>
<LuckyChicken91_twitter> but if crystal is official out for windows then it will show windows right?
Elenian has quit [Client Quit]
<oprypin>
LuckyChicken91_twitter, when Crystal runs on Windows, flag?(:windows) will be present
<FromGitter>
<straight-shoota> yes, you should already be able to use this code `{% if flag?(:windows) %} puts "I'm using windows" {% end %}`
<oprypin>
currently you are running it under a reimplementation of a linux kernel
<FromGitter>
<LuckyChicken91_twitter> ik
<FromGitter>
<LuckyChicken91_twitter> can i btw directly put the flag out without testing which it is?
<oprypin>
no
<FromGitter>
<LuckyChicken91_twitter> oh ok
<FromGitter>
<LuckyChicken91_twitter> uh can i then see which the flag can be?
<FromGitter>
<LuckyChicken91_twitter> all possbilities
<oprypin>
in the future there may be ways to get the system name as a string, but currently that's all we have
<FromGitter>
<straight-shoota> those flags however do not relate directly to operating systems. `:unix` for example entails quite a few different OSes
<FromGitter>
<straight-shoota> arm* and *68* are obviously hardware architectures
<hightower3>
Are is_a? and === identical in performance?
<oprypin>
hightower3, no, and not even in functionality
<oprypin>
is_a? is a syntax feature, === is a wrapper for it that does not carry over the type hints for the compiler
Ven_ has joined #crystal-lang
<FromGitter>
<straight-shoota> @LuckyChicken91_twitter the link I gave you only details the "meta" flags, there might also be others not included in any of these groupings
<FromGitter>
<LuckyChicken91_twitter> oh
<FromGitter>
<LuckyChicken91_twitter> ah no matter i will use these temporarily
<oprypin>
straight-shoota, yeah it's directly from llvm target triple, but then try to find the actual possible values for it
<hightower3>
Thanks. For spec tests, what's the way to initialize some @instance_var before tests are ran? If I define some before_each block and try to set it there, it tells me I can't use instance vars at top level
<oprypin>
hightower3, can't really do that. specs are obviously not classes nor modules so yeah instance vars don't work there
<oprypin>
if you can define a global (maybe even variable would work) outside of `describe` that could work
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<LuckyChicken91_twitter> uh can someone pls explain me macros? for me they are just the dark deep of crystal
<FromGitter>
<straight-shoota> do you know a templating engine like Jinja, Liquid, Twig, ...?
<FromGitter>
<LuckyChicken91_twitter> no
<FromGitter>
<straight-shoota> No templating at all or just not the mentioned engines?
<FromGitter>
<straight-shoota> Basically, macros generate code from a template. This generated code is inserted at the place where the macro is called.
<FromGitter>
<LuckyChicken91_twitter> ah ok
<hightower3>
Hm, looks like Tuple can't be indexed using -1
<oprypin>
:)
<FromGitter>
<LuckyChicken91_twitter> what are the differences between tuple and array?
<hightower3>
tuple is created on the stack, it is known at compile time, and you can't modify it after creation
<oprypin>
the important part is that each item has its own type known at compile time
<FromGitter>
<LuckyChicken91_twitter> i will still use arrays
<oprypin>
lol
<FromGitter>
<LuckyChicken91_twitter> i like arrays
<oprypin>
of course you will because you just want ruby and not learn
<FromGitter>
<LuckyChicken91_twitter> who programed this bot
<oprypin>
@jhass
<FromGitter>
<LuckyChicken91_twitter> @jhass your bot is not good enough
<oprypin>
...
<FromGitter>
<bararchy> And if we are talking about @jhass , dude when you get sometime , can you please push a version in the crystal-git aur package ? Thankssss :):):)
<oprypin>
bararchy, there is no need to update crystal-git unless the build breaks. it's always latest.
<oprypin>
just rebuild/reinstall
<FromGitter>
<distinct> Whats the best way to callback a method?
<oprypin>
that's not a verb or anything that makes sense
<crystal-gh>
[crystal] oprypin opened pull request #4716: Remove '$0' special syntax (master...zero) https://git.io/vQd6f
<hightower3>
What's the most direct replacement for for?
<FromGitter>
<johnjansen> use case @hightower3 :-)
<FromGitter>
<johnjansen> not `case` but a usecase
<hightower3>
standard for (i=0;i<10;i+=1) ...
<FromGitter>
<johnjansen> 1) times do |i|
<FromGitter>
<straight-shoota> or `0.upto(10) do |i|`
<FromGitter>
<johnjansen> or (0..10).each do |i|
<hightower3>
hm, hm... yeah, probably acceptable
<oprypin>
and dont forget `Number#step(*, to = nil, by = 1)`
<FromGitter>
<johnjansen> probably?
<FromGitter>
<johnjansen> what are we missing @hightower3
<FromGitter>
<straight-shoota> I think step makes only sense when you want different step then 1
<oprypin>
well sure, but the question was a replacement for `for`
<FromGitter>
<johnjansen> agreed, but from the “probably acceptable” comment, he must need something else
<oprypin>
`i = 0; while i < 10; i += 1; end`
<FromGitter>
<johnjansen> yeah, step seems to be the only thing missing unless its the condition component
<FromGitter>
<straight-shoota> I assumed "standard" refers to a loop incrementing by one
<FromGitter>
<johnjansen> haha @oprypin is there already
<hightower3>
oprypin, yes, I was using that approach so far :)
<hightower3>
but I didn't like that the increment had to be at the bottom
<hightower3>
<hightower3>
Shouldn't Array#clear be called #clear!
<oprypin>
hightower3, mutating methods get a '!' only when a corresponding non-'!' method would also make sense
<oprypin>
or in a simpler way, dont need '!' when it's obvious anyway
<FromGitter>
<johnjansen> imo i have always thought that `!` should be consistently used as a mutating version indicator, it make it all very predictable
<hightower3>
hm, interesting approach.. I mean, it may be known/guessable for some basic/built-in methods whether a non-! makes sense or not, but for general, other people's modules, a user can't be expected to know the inner workings/data structure and whether non-! exists/makes sense or not.
<hightower3>
Exactly johnjansen
<Papierkorb>
If it's hard to tell from the API, then the API is bad
<hightower3>
Well, yeah, when you're looking at the API the doubt is already cleared up since you're already on the listing of available methods
<hightower3>
But it prevents you from guessing/knowing in advance
<Papierkorb>
No docs
<FromGitter>
<johnjansen> and being able to guess is a major productivity boost
<Papierkorb>
Also, having ! everywhere would be tedious and would make the bang lose its meaning real quick. `#insert!` and stuff?
<hightower3>
Yeah, you're right on that
<hightower3>
What's a straightforward way to trim (shorten) array to certain size?
<hightower3>
(discarding all elements that fall out of the upper bound)
<Papierkorb>
You want to remove the last n elements?
<hightower3>
I want to keep the first 8 elements in the array, discarding everything else
<Papierkorb>
See Array#pop
<Papierkorb>
There's sadly no discarding delete in Array. Looks like missing functionality.
<Papierkorb>
If you don't want to modify the original array, just go with `ary[0, 7]`
<Papierkorb>
0, 8*
<oprypin>
Papierkorb, hightower3, in that kate `ary.first(8)`
<oprypin>
dont know how "case" became "kate"
<hightower3>
Right, I was hoping for some in-place modification
<oprypin>
dont see any
<Papierkorb>
johnjansen, though I really like C++/Qt's naming convention: Method names are verbs, or end in one. If the verb is in past tense, a copy is returned. If it's not in past tense, the original is modified. E.g.: `someList.sort();` vs `someList.sorted().somethingElse();`
<oprypin>
hightower3, `ary[8..ary.size] = []` is an option then
<oprypin>
but i think you're better off reassigning anyway
<hightower3>
It seems that array.delete_at 8..-1 works
<oprypin>
that is good
<FromGitter>
<LuckyChicken91_twitter> if im installing my shard then there appears a long random text! not like in other shards the version: Updating https://github.com/LuckyChicken91/myshard.git ⏎ Using myshard (7q6ab932r250c075f16416ae512j0a61ae50dk1b)
<oprypin>
i don't think the "random text" was copied unchanged :D
<oprypin>
LuckyChicken91_twitter, other projects used a git feature called 'tags'
<oprypin>
`git tag v1.0.0; git push --tags`
<oprypin>
make sure this tag matches what you have in shard file, otherwise it's silly :p
<FromGitter>
<LuckyChicken91_twitter> yes i changed the "random text" because i was not sure that i can get hacked if im publiciting the valid random text
<oprypin>
meanwhile, if you write `git log` you'll see that random text as your latest commit id
<oprypin>
no it's ok
<FromGitter>
<LuckyChicken91_twitter> oh okay
pwned has quit [Ping timeout: 240 seconds]
<FromGitter>
<LuckyChicken91_twitter> short question to linux: how can I just go one folder back?
<oprypin>
cd .. ?
<oprypin>
`cd ..`
<FromGitter>
<LuckyChicken91_twitter> no! now im at the beginning of the system
<Papierkorb>
LuckyChicken91_twitter, please read up on bash and git. It'll help you immensely in the long run.
<FromGitter>
<LuckyChicken91_twitter> okay
sagax has joined #crystal-lang
<oprypin>
LuckyChicken91_twitter, have you considered logging in to gitter with your github account instead
<oprypin>
won't have that annoying _twitter thing
<FromGitter>
<LuckyChicken91_twitter> yes
<FromGitter>
<LuckyChicken91_twitter> i have
<FromGitter>
<LuckyChicken91_twitter> but i have registered me with my twitter account in gitter
greengriminal has quit [Quit: Leaving]
<oprypin>
ok so log out and log in with github?
<FromGitter>
<LuckyChicken91_twitter> uh i think my gitter account and github account is not connected
<FromGitter>
<LuckyChicken91_twitter> 2 different accounts
<FromGitter>
<LuckyChicken91_twitter> i cant use the class which i defined in the shard
<oprypin>
cool cool
<FromGitter>
<LuckyChicken91_twitter> everything is working but not the class
<FromGitter>
<LuckyChicken91_twitter> do you know why, oprypin?
<FromGitter>
<LuckyChicken91_twitter> do i need to use modules instead of classes in my shard?
<oprypin>
when will it end
<FromGitter>
<LuckyChicken91_twitter> what?
thews has quit [Ping timeout: 245 seconds]
<FromGitter>
<LuckyChicken91_twitter> what do you mean oprypin
<oprypin>
LuckyChicken91_twitter, you should put more effort into your questions (and communication overall), make them more specific while still providing context. and maybe you don't even need to ask, just see what other people are doing, and read documentation first!
<oprypin>
what i mean is that i'm really annoyed
<FromGitter>
<LuckyChicken91_twitter> hm my goal was to annoy nobody here
<FromGitter>
<LuckyChicken91_twitter> but i failed
<FromGitter>
<LuckyChicken91_twitter> thats sad
<oprypin>
hey, part of that is on me
<hightower3>
I have a line: r1 += (r2 - r1) * alpha | 0; . And when I run it it tells me "undefined method '|' for Float64". What am I missing here?
<oprypin>
one of these things is a Float64
<oprypin>
what's the point of | 0 now?
<oprypin>
have you been secretly doing javascript
<oprypin>
can't easily recover from that
<hightower3>
Hehe ;-)
<oprypin>
hightower3, so i think that you meant to apply the horrible hack that javascript truncates numbers when you use | 0 but obviously here it's nonsense
<hightower3>
Yeah, needed a to_i in any case, and to remove |0
<FromGitter>
<fridgerator> are there any examples of testing what happens inside of a spawn block with spec? or is it possible?
<oprypin>
fridgerator, make the block do side effects, or better push to a channel
<oprypin>
not exactly sure about the use case
<FromGitter>
<fridgerator> one sec, i'll link what i'm trying to test
Guest16543 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Liosha>
osprypin, many thanks you, I will play with crystalize.py, great work :-)
<hightower3>
Ah help me a little bit here please. I have a method like def test( arg : Hash of String => String | Bool | Int32). But when I call it, it tells me e.g.: nstance variable '@options' of Cls must be (Hash(String, Bool | Int32 | String) | Nil), not Hash(String, Bool | String)
<Liosha>
hightower3, maybe you can do options.as(Hash(String, Bool | Int32 | String) | Nil))
<oprypin>
hightower3, that's... not valid syntax there
Liosha has left #crystal-lang [#crystal-lang]
<hightower3>
I must be tired.. What is pestering me is that it's not allowing me to do something like: def tput(options : Hash(String|Int32|Bool) = {}). It complains that I must specify {} as "{} of KeyType => KeyValue"
<oprypin>
though that's still not valid cuz 2 types
<oprypin>
Liosha is gone..
<FromGitter>
<codenoid> :O
jihantoro has joined #crystal-lang
jihantoro has quit [Client Quit]
<FromGitter>
<elorest> Apparently this base91 implementation that I build yesterday with <oprypin>s help is 7 times slower than base64. https://carc.in/#/r/2d9b
<oprypin>
of course it is
<FromGitter>
<elorest> Because of extra logic since 91 isn't a binary number?
<oprypin>
base64 is 4 bytes to get 3 bytes, and this is god knows what kind of abomination
<FromGitter>
<elorest> kilo
<oprypin>
hm the implementation of base64 in standard library is still really annoying
<oprypin>
probably because it's crazy optimized
<FromGitter>
<elorest> Adobe uses base85 for everything and it seems like it would match weird to bytes too.
<oprypin>
because one could write a base64 implementation in like 5 lines
<FromGitter>
<elorest> yeah that's what I thought.
rohitpaulk has quit [Ping timeout: 260 seconds]
sz0 has joined #crystal-lang
Ven has joined #crystal-lang
Ven is now known as Guest72659
<FromGitter>
<distinct> Day 2 using crystal
<FromGitter>
<distinct> Still love it :D
<FromGitter>
<fridgerator> 👍
<FromGitter>
<elorest> 👍
hightower3 has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
Guest72659 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]