bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mgarciaisaia has joined #crystal-lang
m94asr has quit [Ping timeout: 248 seconds]
m94asr has joined #crystal-lang
bjz has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 252 seconds]
Raimondii is now known as Raimondi
Raimondi has quit [Remote host closed the connection]
Raimondi has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 240 seconds]
<Dreamer3>
drosehn: Are there any docs on moving ones existing homebrew? I wonder how much of a disaster that is
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 276 seconds]
<FromGitter>
<drosehn> Note that some installs will go *much* quicker when you're using `/usr/local`, because if you're using some other directory then `brew` decides that it needs to compile everything from scratch.
ome has quit [Quit: Connection closed for inactivity]
<Dreamer3>
example?
<Dreamer3>
i've never heard of that before
<Dreamer3>
it should be aware of which dependencies are installed either way
<Dreamer3>
my install downloads the binaries vs building just fine when they are available
<FromGitter>
<drosehn> never heard of what before?
<Dreamer3>
install speed differences because of differences in compile times
<Dreamer3>
is there a ticket?
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 264 seconds]
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
Liothen has joined #crystal-lang
<jaitaiwan>
no overload matches 'Array(String)#<<' with type Array(String)
<jaitaiwan>
Overloads are:
<jaitaiwan>
- Array(T)#<<(value : T)
<jaitaiwan>
^ anyone seen that before
<jaitaiwan>
the message looks to me like it's saying "Unexpected Foo expecting Foo"
<jaitaiwan>
Which is completely illogical
<FromGitter>
<ezrast> It wants `String` and you're giving it `Array(String)`; consider `concat` instead of `<<`?
soveran has quit [Remote host closed the connection]
<splitty_>
Hey, I need to somehow 'undef' a struct. Is that possible?
<splitty_>
I want to test my custom Char class with the Crystal spec tool, but I keep getting errors because some constants are already defined.
<splitty_>
That happens because Char is already included by spec. There doesn't seem to be a --prelude option for spec though.
akwiatkowski has quit [Ping timeout: 252 seconds]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
<unshadow>
splitty_: I think you can pass all "build" flags to spec ( --prelude Use given file as prelude
<splitty_>
Well unshadow if I add --prelude=empty I'm still getting the error
<splitty_>
I think it's because spec requires char internally
<splitty_>
Looks like this is an issue that I can't resolve in my codebase
<splitty_>
The language would need to support private includes
<splitty_>
Rust does that pretty nicely. You can either include a file privately (import) or publicly (import+export)
minus has quit [Ping timeout: 258 seconds]
RX14 has quit [Ping timeout: 258 seconds]
RX14 has joined #crystal-lang
akwiatkowski has joined #crystal-lang
minus has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mgarciaisaia has joined #crystal-lang
michael_campbell has joined #crystal-lang
<splitty_>
Hey, I'm having some issues with conditional compilation
<splitty_>
I'm trying to do the following:
<splitty_>
{% if flag?(:test) %} module Std {% end %}
<splitty_>
{% if flag?(:test) %} end {% end %}
<splitty_>
# some code
<splitty_>
For some reason, the last line is an error: Unexpected SPACE after `end`
gloscombe has quit [Read error: No route to host]
akwiatkowski has quit [Ping timeout: 255 seconds]
bew78 has joined #crystal-lang
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
pduncan has joined #crystal-lang
Raimondi has quit [Read error: Connection reset by peer]
mark_66 has quit [Remote host closed the connection]
Raimondi has joined #crystal-lang
DeBot has quit [Remote host closed the connection]
DeBot has joined #crystal-lang
gloscombe has joined #crystal-lang
Dreamer3 has quit [Ping timeout: 252 seconds]
pawnbox has joined #crystal-lang
akwiatkowski has joined #crystal-lang
mrus has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<jeromegn>
is there a way to block on IO? like wait for an io to have something to read from it?
<jeromegn>
I'm trying to build a reverse TCP tunnel with a persistent connection to a "server". when the server receives a TCP request, it forwards it through the tunnel to the "client" which will then forward it to another TCP server locally.
<bew78>
you could use IO.select with a timeout to block until something is there
<bew78>
jeromegn: see above ^^^^^^^^^^
<jeromegn>
yea I was reading about that. I'll give it a shot, thanks bew78
<bew78>
you're welcome !
<jeromegn>
that seems to return immediately
<jeromegn>
I'll paste some code
<jeromegn>
(maybe)
<jokke>
Hi
mrus has quit [Ping timeout: 245 seconds]
<jokke>
I've been off the crystal train for a while. How is crystal progressing? What are the next steps to 1.x and how far are we?
FromGitter has quit [Ping timeout: 256 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
mrus has joined #crystal-lang
<rkeene>
Hmm, this bitcode plan didn't work well at all -- seems to be highly platform specific
<rkeene>
Maybe this is a good use for pnacl
Renich has joined #crystal-lang
mrus has quit [Quit: leaving]
mrus has joined #crystal-lang
bjz has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
bew78 has quit [Ping timeout: 256 seconds]
<RX14>
jeromegn, IO blocks by default, what do you mean?
<jeromegn>
RX14: I see. I mean: some_io.read will return immediately even if there's nothing to read. Trying to figure out a way to block until there's something to read
<RX14>
no it won't
<RX14>
it does not do that
<RX14>
it blocks
<jeromegn>
mmm
Dreamer3 has joined #crystal-lang
<RX14>
if read() returns with 0
<RX14>
it's EOF
<jeromegn>
hmm, you're right! wth was I doing before...
<jokke>
RX14: thanks!
<RX14>
rkeene, the crystal compiler will always output platform-specific code
<rkeene>
RX14, The llvm-bitcode output
<RX14>
of course
<RX14>
there's embedded asm
<jokke>
are there any plans for embedded devices support?
<jokke>
*architectures
<RX14>
jokke, we have arm support
<jokke>
what
<jokke>
srsly
<RX14>
runs on raspi 1 and 3
<Papierkorb>
yes
<RX14>
yup
<jokke>
!!!!
<jokke>
omg!
<jokke>
that is so awesome!
<RX14>
avr seems a bit unrealistic
<RX14>
but potentially possible
<RX14>
given llvm support
<jokke>
what about cortex m0?
<jokke>
and such
<RX14>
although most embedded is arm these days
<jokke>
^
<jokke>
RX14: but the smaller arms
<RX14>
it's generic arm support
<RX14>
it's 1 target for both raspi versions iirc
<jokke>
but how does this work with the standard lib
<jokke>
i mean
<RX14>
it's still tied to the gnu abi and libc
<jokke>
ah
<jokke>
yes
<jokke>
ok
<RX14>
you need linux
<jokke>
yeah. that's what i thought
<jokke>
any plans in supporting arm-none-eabi then? :)
<RX14>
yes
<jokke>
wow!
<RX14>
--prelude=empty
<RX14>
start with no stdlib and build your own
<RX14>
people have built x86 OSes
<RX14>
so should be fine for arm
<RX14>
beyond my expertise though
<RX14>
llvm does most of the heavy lifting
<jokke>
this is exciting news
<Yxhuvud>
splitty seems to find quite a lot of small issues when doing that though. But it is good that they are found so they can be fixed or improved
<RX14>
yeah it's not really build for it
<jokke>
splitty?
<RX14>
but
<RX14>
jokke, the guy making the os
<jokke>
ah
<jokke>
ok
<jokke>
RX14: so, if i use --prelude=empty what remains?
<RX14>
because the stdlib isn't really built to support that well
<jokke>
that's too bad
<Papierkorb>
No one needs #to_s anyway *cough*
<RX14>
you can call free() everywhere
<jokke>
yeah!
<RX14>
but you need to write your own stdlib with explicit deallocation
<jokke>
why can't the stdlib have a delete method which would deallocate it?
<jokke>
s/it/an object/
<RX14>
because the stdlib doesn't do that itself
<jokke>
ah
<jokke>
yeah
<jokke>
libgc
<RX14>
you could
<RX14>
thats what free() is
<RX14>
but i'm saying you can't reuse the stdlib
<RX14>
because it never really calls free()
<RX14>
it just expects a GC
<RX14>
Papierkorb, all that works without the GC?
<Papierkorb>
RX14: It compiled just fine, as long you're careful to not use methods like #to_s. That's why String is actually missing in there, as it requires "io" which then wants libevent2 and friends. I basically took string.cr because of that and patched all of that out.
<RX14>
yeah...
<RX14>
maybe we should consider writing "empty prelude specs"
<RX14>
force modularity a bit
<RX14>
so that requiring string works without requiring libevent
<Papierkorb>
If string would work without it would make lots of things much easier already
<RX14>
yeah
<Papierkorb>
that's really the biggest issue I faced
<rkeene>
RX14, Right, I'm trying to build a Crystal that can be rebuilt for different platforms without requiring Crystal
<RX14>
well requiring IO is fine
<RX14>
but not
<RX14>
IO::FileDescriptor
<RX14>
so IO::memory is fine
<RX14>
rkeene, you can't
<RX14>
it's just like a C compiler
<RX14>
you need a C compiler
<RX14>
to compile it
<RX14>
except C compilers dont have this issue because they iterate so much slower
<rkeene>
Well, I mean -- I can... I just don't want to go to that extreme if possible
<RX14>
and C is standardized
<rkeene>
(Using pnacl-translate)
mrus has quit [Quit: leaving]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<RX14>
hmm
<rkeene>
pnacl is, in theory, supported by Crystal since it's really just Linux/le32 (no matter what the native platform is)
<Yxhuvud>
also the cpu makers tend to write c compilers for their cpus (or mod the existing ones), so everyone else doesn't have to
<Yxhuvud>
at least the exotic ones.
<RX14>
yeah they just write llvm-backend these days I hear
<RX14>
at least for the smaller CPUs
<jokke>
so if i were to compile none-eabi arm code i would have to just compile with --prelude empty --cross-compile --mcpu ... --mattr ?
<RX14>
jokke, probably?
<RX14>
you can try it
<jokke>
but don't i need a toolchain?
<RX14>
the cross-compile generates an object file
<RX14>
you need a toolchain to link
<jokke>
yeah
<RX14>
usually cross-compile is used for bootstrap
<RX14>
so we just copy tyhe object file to the target arch
<RX14>
and run the linker command the compiler spits out
<RX14>
ofc thats assuming the target arch is a unix
<jokke>
it spits out a linker command?
<RX14>
yup
pawnbox_ has joined #crystal-lang
<jokke>
i have to try this
<RX14>
cc whatever
pawnbox has quit [Ping timeout: 240 seconds]
FromGitter has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
<RX14>
jokke, fun outside lib just defines a crystal function withouit a mangled name
<rkeene>
(or, slightly better, an enhanced brainfuck -- like my "sf" which is more than an ISA, also includes a loader format)
<jokke>
i see!
<RX14>
rkeene, well if you write a LLVM backend, get it upstreamed, and port crystal
<rkeene>
Google upstreamed Lanai, which might be close enough
<rkeene>
I might be able to write an interpreter for it easily
<rkeene>
Apparently they're going to release a simulator for it
<jokke>
RX14: if i want to write my own prelude how can i use it?
<jokke>
i tried --prelude ./my_prelude.cr but it complains that it can't find the file
<Papierkorb>
jokke: --prelude=empty and then just require your own in
<jokke>
mh ok
<jokke>
i don't really need main
<RX14>
rkeene, you could always just build qemu and build in a VM
<jokke>
i would've replaced it with _start
<jokke>
but ok
<rkeene>
RX14, That might be less work overall, but I'd have to check to see how good the platform support is for TCG and user emulation (from what I recall, not so good)
FromGitter has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
gloscombe has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Ping timeout: 260 seconds]
<jokke>
can i force code to be put in a specific section?