glenab has quit [Remote host closed the connection]
cyjimmy264 has joined #crystal-lang
pawnbox has joined #crystal-lang
glenab has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
BlaXpirit has joined #crystal-lang
bcardiff has joined #crystal-lang
gamemanj has joined #crystal-lang
datanoise has quit [Ping timeout: 244 seconds]
barosl has quit [Quit: Leaving]
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 244 seconds]
Ven has joined #crystal-lang
Ven has quit [Client Quit]
barosl has joined #crystal-lang
silverweed has joined #crystal-lang
<silverweed>
hello guys, can I ask help about modules?
<silverweed>
I have a project with the standard directory hierarchy (libs/ and src/), and have several files under src/ which are under module "LE"
<silverweed>
in one of these files, I'm trying to define some util functions under the submodule Utils
<silverweed>
so, let's say I have file utils.cr where the "get_file" util function is defined (under module Utils)
<silverweed>
I want to call this function from file foo.cr. But I cannot figure out how to do it, as if I do "include Utils", or "include LE::Utils", the compiler tells me "undefined constant"
<silverweed>
if I don't include anything, it says "undefined method get_file"
<silverweed>
another oddity is that if I compile only foo.cr, without using "Utils" but only the bare function "get_file", it compiles; but if I compile all the files it gives me undefined method
bcardiff has quit [Quit: bcardiff]
datanoise has quit [Ping timeout: 240 seconds]
barosl has quit [Quit: Leaving]
reed_ has joined #crystal-lang
barosl has joined #crystal-lang
buggs has joined #crystal-lang
<silverweed>
...is the compiler sensitive to the order of file i pass in?
<yxhuvud>
I see. I guess I'll have to use a struct instead then, since that seem to work.
<jhass>
yxhuvud: however feel free to open an issue, the wonky overload matching on unions & parent types is starting to get too much of a pain point of the language, the usecases that don't work we see the better
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
<benoist>
i'm not sure if thats the way to go, I used that to compile the code, but inspecting the output of the function yields an empty array anyway
<crystal-gh>
[crystal] MakeNowJust opened pull request #1770: Add `crystal help` and `crystal version` subcommand (master...crystal-help) http://git.io/vCNbv
<yxhuvud>
Hmm. What does "Program received and didn't handle signal BUS (7)" mean? compiler crash? infinite loop? something else?
<unshadow>
benoist: thats wierd ... I did a clone of your repo, then, git checkout -b origin/feature/0.8+
<benoist>
-b makes a new branch right
<unshadow>
benoist: oh ....... my bad
<benoist>
i think you need to omit the -b and just do git checkout feature/0.8+
<unshadow>
benoist: OK, now it's working
<benoist>
:)
<unshadow>
benoist: let me take a look now :)
gamemanj has quit [Remote host closed the connection]
gamemanj has joined #crystal-lang
<unshadow>
benoist: What does "out" do ? as in "out outl" ?
<benoist>
I believe the C function copies the result into that variable
<benoist>
you changed it to pointerof, which might do the same but allows you to initialize the pointer yourself
<unshadow>
benoist: It expects for a Pointer(Int32), So I guess "out" creates a pointer of the data ? anyway even with my change this dosn't seems to be the issue, I'll keep looking
<unshadow>
benoist: Maybe something change regarding .size\.length that broke something
<benoist>
unshadow: yes that's my guess as well
<unshadow>
jhass: can you remmber if the .length to .size for array change was more then a symantical change ?
<jhass>
what do you mean?
<jhass>
for Array it didn't involve any compiler changes, only for Tuple
<unshadow>
jhass: We have an issue with datanoise's OpenSSL.cr lib, it was built against 0.7.0, it used a few "Array.length=" statments, for compatabilty we changed those to "Array.size=", but now something seems to be broken and we suspect that maybe there was more to this change then just the method name
<unshadow>
jhass: If not, then we should keep looking elseware
<benoist>
unshadow: I've got something
<benoist>
changing Array to Slice gets some output
<jhass>
I never realized we even have Array#size=, that seems odd
<unshadow>
It was private before, and became protected now, this could be one of the issues we have
<unshadow>
benoist: Pulling
<benoist>
jhass: do you know what's better to use Array(UInt8) or Slice(UInt8) when dealing with C calls?
<jhass>
I prefer Slice most of the time. StaticArray is also a (stack focused) option
<unshadow>
benoist: ok, we are getting there, now we have an issue with "\0" before and after the cipher text
<unshadow>
benoist: But if you look, the numbers are ok, just the zeros need to go
<benoist>
and it's not complete
<unshadow>
benoist: Oh, true
<benoist>
I really have feeling it might need a bigger overhaul tho
<unshadow>
I wish datanoise would take a look, I managed to help with a few added features to the lib, but those parts are really Low-level implamentations of cryptography
nakilon has joined #crystal-lang
gamemanj has quit [Remote host closed the connection]
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<benoist>
unshadow: it's also one those things that needs to be done properly, if the implementation misses key things the library is basically useless in terms of security
<unshadow>
benoist: True.
gamemanj has joined #crystal-lang
<crystal-gh>
[crystal] jhass pushed 2 new commits to master: http://git.io/vCNhy
<trapped>
i did try in fact, but when i tried it didn't work, after a couple changes (including adding the spacing) it worked but i wasn't sure it was that so i said "i think"
<jhass>
that's still reasonable depending on your machine
<jhass>
--release takes time ;)
<ddfreyne_>
Yeah, I’ve noticed --release making the compilation quite a bit slower… but 5+ minutes seems to be far more than I’m used to.
<ddfreyne_>
I don’t think previous Homebrew crstal releases were compiled using --release…
<ddfreyne_>
Oh! It finished.
<ddfreyne_>
I guess I was just impatient!
<jhass>
;)
trapped has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
reed_ has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
canhtak has joined #crystal-lang
benoist has joined #crystal-lang
nakilon has quit [Ping timeout: 250 seconds]
<ddfreyne_>
I used a few languages for playing around with game design… Crystal seems to be the one that might stick.
nakilon has joined #crystal-lang
<ddfreyne_>
I love (need?) prototyping functionality, and Ruby (RubyGame) and Lua (LÖVE) offer that. But once you get to the point where the game is slow, you need profiling tools and probably an environment that’s not as slow…
<ddfreyne_>
Here’s hoping that Crystal will actually bridge that gap.
<gamemanj>
Native code FTW! Though I'm wondering what kind of 2D game gets to that point... large quantity of bullets avoidance?
<ddfreyne_>
gamemanj: I had a 2D top-down Minecraft-like game written in LÖVE, and when performance started going downhill, I had to resort to profilers.
<ddfreyne_>
gamemanj: Sadly, the profiling tools make the code execute 10x slower, and there’s no real useful output.
<ddfreyne_>
gamemanj: I can use Instruments.app + dtrace to get insights in what my app is doing!
<gamemanj>
Ah, I presume said game has an infinite world and chunks and all the things that generally nom evem more resources like biscuits from a biscuit tin...
<ddfreyne_>
gamemanj: It was getting trouble at 512x512 tiles, so definitely not big at all. But the lack of tooling for making something performant put me off.
<ddfreyne_>
Not that Lua by itself is necessary slow--it actually has pretty nice performance.
<ddfreyne_>
But the answer to “how do I make it fast?” is for me a lot more clear in Crystal than in Lua
<ddfreyne_>
(LÖVE is great btw.)
benoist has quit [Remote host closed the connection]
benoist has joined #crystal-lang
gamemanj has quit [Ping timeout: 256 seconds]
nakilon has quit [Ping timeout: 264 seconds]
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
datanoise has quit [Ping timeout: 265 seconds]
<BlaXpirit>
ddfreyne_, what lib are you looking at for making games?
glenab has quit [Read error: Connection reset by peer]
trapped has joined #crystal-lang
glenab has joined #crystal-lang
<CompanionCube>
heck, in some cases LuaJIT can be faster than C.
glenab has quit [Remote host closed the connection]
glenab has joined #crystal-lang
datanoise has joined #crystal-lang
BlaXpirit has quit [Quit: Konversation]
<buggs>
CompanionCube, last time I checked luajit was C ;-)
datanoise has quit [Ping timeout: 246 seconds]
datanoise has joined #crystal-lang
cyjimmy264 has quit [Ping timeout: 244 seconds]
glenab has quit [Remote host closed the connection]
xd1le has joined #crystal-lang
glenab has joined #crystal-lang
canhtak has quit [Quit: canhtak]
kulelu88 has joined #crystal-lang
kulelu88 has joined #crystal-lang
glenab has quit [Remote host closed the connection]
Philpax has joined #crystal-lang
ukd1 has joined #crystal-lang
<ukd1>
I'm trying to convert an array to a hash; Hash[*some_array] isn't working? Any tips?