Skip to content

Instantly share code, notes, and snippets.

View krestenkrab's full-sized avatar

Kresten Krab Thorup krestenkrab

View GitHub Profile
@krestenkrab
krestenkrab / keybase.md
Created February 5, 2019 15:49
keybase.md

Keybase proof

I hereby claim:

  • I am krestenkrab on github.
  • I am drkrab (https://keybase.io/drkrab) on keybase.
  • I have a public key ASBs-18J2gBlouOQMVkDDMJQ9jmqLyKGC5cnhj673sSfHgo

To claim this, I am signing this object:

@krestenkrab
krestenkrab / erjang-status-aug15.md
Last active December 22, 2017 18:46
Notes on the current status of Erjang

Elixir on Erjang

The last few weeks I've spent some night hacking time to get Erjang to be able to run Elixir. Here's a short note on the current status for those interested.

The bottom line is that we can now boot the Elixir REPL, it looks like this:

krab$ ./bin/iex 
Warning: could not run smart terminal, falling back to dumb one
Aug 26, 2013 11:11:14 AM erjang.EModuleManager$FunctionInfo$1 invoke
@krestenkrab
krestenkrab / beam estones
Last active June 25, 2016 00:53
Running the estone test suite for Erjang vs BEAM.
EStone test completed
**** CPU speed UNKNOWN MHz ****
**** Total time 1.740884613333333 seconds ****
**** ESTONES = 260159.54 ****
{'ESTONES',2.601595e+05}
Title Millis Estone % Loops
list manipulation 52.07 29171.60 7 6400
small messages 391.62 7915.86 10 1515
#!/bin/bash
echo Building Google Protobuf for Mac OS X / iOS.
echo Use 'tail -f build.log' to monitor progress.
(
PREFIX=`pwd`/protobuf
mkdir ${PREFIX}
mkdir ${PREFIX}/platform
@krestenkrab
krestenkrab / gist:6851763
Created October 6, 2013 09:39
Elixir @ JVM now passing 2287 / 2335 tests (48 failed).
Oct 06, 2013 11:26:10 AM erjang.EModuleManager$FunctionInfo$1 invoke
INFO: MISSING 'Elixir.Foo.Bar.Baz':sum/2
Oct 06, 2013 11:26:10 AM erjang.EModuleManager$FunctionInfo$1 invoke
INFO: MISSING 'Elixir.Foo.Bar.Baz':sum/2
tokenizer_test: chars_test...*failed*
in function tokenizer_test:chars_test/0 (tokenizer_test.erl, line 146)
**error:{badmatch,[{number,1,48350}]}
=======================================================
@krestenkrab
krestenkrab / to_ulf.erl
Created October 2, 2013 09:44
first/next implementations for hanoidb
-module(to_ulf).
-include_lib("hanoidb/include/hanoidb.hrl").
first(Ref) ->
case hanoidb:fold_range(Ref,fun(K,V,Acc) -> [{K,V}|Acc] end,[],
#key_range{from_key= <<>>, limit=1, to_key=undefined})
of
[] -> '$end_of_table';
[{Key,Value}] -> {Key,Value}
@krestenkrab
krestenkrab / changes.md
Last active December 23, 2015 17:39
Making n2o/skyline work on MacOS X / R16B02

In addition to erlang R16B02, you need a more recent bash because the scripts use bash associative arrays; a feature which is not present in the version of bash distributed with MacOS X.

brew install node
brew install bash

## put new bash on path
export PATH=/usr/local/bin:$PATH
@krestenkrab
krestenkrab / gist:6538694
Last active December 22, 2015 22:18
Elixir test suite on Erjang
Krestens-MacBook-Pro:elixir krab$ make test_kernel -f Makefile.e
==> elixir (compile)
==> kernel (exunit)
Elixir.URITest
* decode (0.5ms)
* decode_query (8.1ms)
* decoder (0.5ms)
* default_port (0.7ms)
* downcase_scheme (0.8ms)
@krestenkrab
krestenkrab / output
Created September 12, 2013 12:00
Testing performance for elixir protocol dispatch for is_record
R16B01 @ x86_64-apple-darwin12.4.0, 1000000 iterations
when matching: binary is 55.46651865727732% faster
when not matching: binary is 17.42297571085909% faster
[{214705,'Foo.List'},
{177297,'Foo.Bin'},
{345924,'Elixir.List'},
{154052,'Elixir.Bin'}]
@krestenkrab
krestenkrab / gist:6494775
Last active December 22, 2015 15:49
Current output of running "make test" in elixir (with Erjang)
Krestens-MacBook-Pro:elixir krab$ make test -f Makefile.e
==> elixir (compile)
Compiled src/elixir_compiler.erl
==> kernel (compile)
Compiled lib/elixir/lib/application/behaviour.ex
Compiled lib/elixir/lib/bitwise.ex
Compiled lib/elixir/lib/behaviour.ex
Compiled lib/elixir/lib/access.ex
Compiled lib/elixir/lib/dict/behaviour.ex
Compiled lib/elixir/lib/code.ex