Skip to content

Instantly share code, notes, and snippets.

[wmoxam:~/projects/crystal] $ ./crystal eval 'puts "hi"'
Error while requiring "prelude": can't find file 'prelude'
[wmoxam:~/projects/crystal] $ CRYSTAL_PATH=/home/wmoxam/projects/crystal/src ./crystal eval 'puts "hi"'
Error while requiring "prelude"
in ./src/prelude.cr:36: while requiring "file"
require "file"
^
$ brew install crystal-lang
Error: crystal-lang-0.18.0 already installed
To install this version, first `brew unlink crystal-lang`
~/projects/crystal [avoid-crashes-when-two-compilers-are-running|…2]
14:44 $ brew unlink crystal-lang
Unlinking /usr/local/Cellar/crystal-lang/0.18.0... 2 symlinks removed
~/projects/crystal [avoid-crashes-when-two-compilers-are-running|…2]
14:44 $ brew install crystal-lang
==> Downloading https://homebrew.bintray.com/bottles/crystal-lang-0.18.2.el_capitan.bottle.tar.gz
######################################################################## 100.0%
abstract class Base
end
class Example1 < Base
end
class Example2 < Base
end
class Test
Day changed to 21 Dec 2015
00:03 -!- smathy [~smathy@unaffiliated/JasonKing] has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
00:24 < Radar> !rvm
00:24 < helpa> RVM (Ruby Version Manager) - http://rvm.io
00:25 < Radar> !forget rvm
00:25 < helpa> The !rvm command has been deleted.
00:26 < Radar> !add rvm Remove RVM and use chruby + ruby-install. Ubuntu guide: http://bit.ly/1mvdEuH Mac guide: http://bit.ly/1QA85bc
00:26 < helpa> The !rvm command is now available.
00:26 < Radar> !forget rvm
00:26 < helpa> The !rvm command has been deleted.
$ ./crystal --version
./crystal:/usr/local/lib/libevent_core.so.1.1: /usr/lib/libevent.so.4.1 : WARNING: symbol(kqops) size mismatch, relink your program
./crystal:/usr/local/lib/libevent_core.so.1.1: /usr/lib/libevent.so.4.1 : WARNING: symbol(pollops) size mismatch, relink your program
./crystal:/usr/local/lib/libevent_core.so.1.1: /usr/lib/libevent.so.4.1 : WARNING: symbol(selectops) size mismatch, relink your program
Crystal 0.9.0 [27c5681] (Sun Oct 25 01:58:45 UTC 2015)
$ uname -rsv
OpenBSD 5.8 GENERIC.MP#1521
_ = $$ / $$
__ = _ - _
@_ = _ + _
$_ = @_ + _
$__ = @_ + $_
$-_ = $__ * $_
@__ = '' << $-_ * ($__ + $_) + @_
$___ = '' << $-_ * $__ - $__ << $-_ * ($__ + @_) << @__ << @__
@___ = '' << $-_ * $__ - $_ * $_ << $-_ * ($__ + $_) - $_ << @__ << @__
@wmoxam
wmoxam / gist:991cadc6d7b0ddfff325
Last active August 29, 2015 14:23
Crystal on OpenBSD
Methods tried, and to be tried
Use Linux emulation to run Crystal compiler. FAILED
- OBSD Linux emulation is only for i386, Crystal binaries are 64-bit. Also OBSD i386 binaries are not compatible with amd64.
Use the first release that used a Ruby compiler to compile the next version (and so on) until we have an up to date version.
- current OBSD has llvm 3.5 in ports, the original Ruby version of Crystal targeted v3.3
- OBSD LLVM port isn't built with LLVM_ENABLE_SHARED, hopefully this is an easy change
- to simplify things it may be easier to build on a version of OBSD that supports LLVM 3.3
$ ruby -v
$ which ruby
$ which gem
$ which bundler
$ gem environment
Dir.glob("*2x.jpg").each do |f|
`convert #{f} -resize 300x187 #{f.gsub(/@2x/, '')}`
end
$ irb
irb(main):001:0> str = Marshal.dump("thing")
=> "\x04\bI\"\nthing\x06:\x06ET"
irb(main):002:0> RUBY_VERSION
=> "1.9.3"
irb(main):003:0> str[0].ord
=> 4
irb(main):004:0> str[1].ord
=> 8