Skip to content

Instantly share code, notes, and snippets.

Lloyd Fournier LLFourn

Block or report user

Report or block LLFourn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@LLFourn
LLFourn / fair_atomic_swaps_response.md
Last active Jan 5, 2019
Re: [Lightning-dev] An Argument For Single-Asset Lightning Network
View fair_atomic_swaps_response.md

This is a response I made to the thread that didn't make it into the archive (I think) :https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-December/001752.html


Happy new year lightning-dev!

This topic is my main area of research at moment so I'm really happy to see a thread about it. In general I agree with ZmnSCPxj's analysis and conclusions. I'd like to add a couple of ideas to this discussion and would greatly appreciate some early peer review on them :)

HTLCs as American call options

@LLFourn
LLFourn / Rakudo.sp
Created Nov 29, 2017
in dev Spit module for building rakudo docker images
View Rakudo.sp
class Rakudo {
constant File $:install-to;
constant $:checkout = '2017.07';
constant File $:clone-to = './rakudo';
constant GitHub $:zef-repo = 'ugexe/zef';
constant GitHub $:repo = 'rakudo/rakudo';
constant Bool $:debug-moar;
static method install-deps on {
@LLFourn
LLFourn / docker_PID1.sh
Last active May 30, 2017
Docker, Getting around PID 1
View docker_PID1.sh
# So you want to pipe shell scripts to docker. But docker runs the container's command as PID 1.
# Linux doesn't set up signal handlers for PID 1.
# This gives you the following problems:
# 1. The script can't kill itself:
echo 'kill $$; echo "Still alive"' | docker run -i --rm alpine sh
# 2. You can't kill the script from outside with a normal kill:
echo "sleep 1000" | docker run -i --rm alpine sh & sleep 1 && kill $!
docker ps # it didn't die
#==== Solving problem 1 ====
View rest.txt
BEFORE:
A 9.0422700
C 10.6984718
B 10.3635278
a 17.9581401
b 21.61539652
c 27.7105599
HEAD:
A 4.126187
C 4.918153
@LLFourn
LLFourn / bench_samcv_branch.sh
Created Apr 7, 2017
The script I used to benchmark samcv++'s branch
View bench_samcv_branch.sh
for i in $(seq 1 5); do
./install/bin/perl6 -e '"a" x 1000000000 ~ "b" ~~ /b/; say now - INIT now;'
done | awk '{ v += $0; i++; }; END { print v/i }'
@LLFourn
LLFourn / native-int-perf.p6
Created Mar 12, 2017
Shows the difference in performance between native ints and vanilla.
View native-int-perf.p6
#!/usr/bin/env perl6
sub perl6-loop($n)
{
my $sum = 0;
for 1..$n -> $i {
for 1..$i -> $j {
$sum += $i+$j;
}
}
@LLFourn
LLFourn / p6-top-10.md
Last active Mar 2, 2017
my Top 10 p6 features
View p6-top-10.md

My top 10 p6 features

My brain did work so I wrote it down. This is more for my use cases than why I think the language will succeed in general.

  1. containers
  2. grammars
  3. multi-dispatch (esp on type narrowness)
  4. lexical $_
  5. easy + sane defaults builtin OO
  6. Types as first class citizens + MOP
  7. lazy iterators
View segfault_backtrace.txt
I've been getting segfaults in this area recently. The trace is a bit different but I guess it's related. It seems that flag_map in gc_mark is no longer allocated so I get segfault.
(lldb) r
There is a running process, kill it and restart?: [Y/n] y
Process 75673 exited with status = 9 (0x00000009)
Process 75691 launched: '/Users/llfourn/src/rakudo/install/bin/moar' (x86_64)
Process 75691 stopped
* thread #1: tid = 0x23cfc68, 0x0000000100063ca4 libmoar.dylib`gc_mark(tc=0x0000000100500290, st=0x0000000101004f40, data=<unavailable>, worklist=0x000000010d27c1a0) + 84 at MVMCallCapture.c:55, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10a72533)
frame #0: 0x0000000100063ca4 libmoar.dylib`gc_mark(tc=0x0000000100500290, st=0x0000000101004f40, data=<unavailable>, worklist=0x000000010d27c1a0) + 84 at MVMCallCapture.c:55
52 MVMuint16 count = ctx->arg_count;
@LLFourn
LLFourn / backtrace.txt
Last active Jun 26, 2016
rakudo segfault 27/6/16
View backtrace.txt
#== WITH LLDB \o/
(lldb) run
Process 41869 launched: '/Users/llfourn/src/rakudo/install/bin/moar' (x86_64)
Process 41869 stopped
* thread #1: tid = 0x1a7644d, 0x0000000100063cf4 libmoar.dylib`gc_mark(tc=0x0000000100402a80, st=0x0000000100804b40, data=<unavailable>, worklist=0x000000010a0e61f0) + 84 at MVMCallCapture.c:55, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x0000000100063cf4 libmoar.dylib`gc_mark(tc=0x0000000100402a80, st=0x0000000100804b40, data=<unavailable>, worklist=0x000000010a0e61f0) + 84 at MVMCallCapture.c:55
52 MVMuint16 count = ctx->arg_count;
53 MVMuint16 i, flag;
54 for (i = 0, flag = 0; i < count; i++, flag++) {
-> 55 if (flag_map[flag] & MVM_CALLSITE_ARG_NAMED) {
View p6-Type-Tiny.pm6
use nqp;
my package EXPORTHOW {
package SUPERSEDE {
class subset is Metamodel::SubsetHOW {
has @!ss-params;
method parameterize($obj,*@params) {
@!ss-params = @params;
$obj;
}
You can’t perform that action at this time.