Skip to content

Instantly share code, notes, and snippets.

View rurban's full-sized avatar
💭
Broke my right shoulder, cannot type much

Reini Urban rurban

💭
Broke my right shoulder, cannot type much
View GitHub Profile
@rurban
rurban / smoke-parrot
Created August 7, 2012 17:26
smoke-parrot shell script
#!/bin/sh
cd /usr/src/parrot/parrot-git || exit
branch=${1:-master}
# stash changes if dirty or detached head
if git symbolic-ref -q HEAD
then
if git status|grep " Changes " 2>/dev/null
then
git stash save "smoke `date +%F` `git name-rev --name-only HEAD`"
@rurban
rurban / blog-todo.md
Created September 17, 2012 23:04
My perl5 TODO list

My perl5 TODO list

Below is a formal list of possible optimizations, which most would agree on. We had these discussion in 2001 with damian were perl6 and perl5i took off. I'd like to work on these for perl5 core and need decisions. Most p5p hackers seem to be informed about the general possibilities and directions, but not all. We'd need this to improve general perl5 performance, and also help static compilation.[1]

@rurban
rurban / nbody-perl-3.perl
Created October 15, 2012 20:48
slow loops with GVSV indices
# The Computer Language Shootout
# http://shootout.alioth.debian.org/
#
# contributed by Christoph Bauer
# converted into Perl by Márton Papp
# fixed and cleaned up by Danny Sauer
# optimized by Jesse Millikan
# de-optimized by Reini Urban
use constant PI => 3.141592653589793;
@rurban
rurban / nqp46-charspec.t
Created December 6, 2012 03:41
ext/nqp-rx/t/nqp/46-charspec.t
# whats wrong with this nqp test file? https://github.com/parrot/parrot/issues/874
# Confused at line 3, near "my %config"
my %config := pir::getinterp__P()[pir::const::IGLOBALS_CONFIG_HASH];
unless %config<has_icu> {
say("1..0 skip no ICU lib");
nqp::exit(0);
}
plan(4);
@rurban
rurban / gist:4226700
Created December 6, 2012 18:15
Day 7 – MIME::Base64 – On encoded strings
<title>Day 7 - MIME::Base64 - On encoded strings</title>
<h2>parrot MIME::Base64 FixedIntegerArray: index out of bounds!</h2>
Ronaldxs created the following parrot <a href="https://github.com/parrot/parrot/issues/813">ticket #813</a> 4 months ago:
<i>"Was playing with p6 MIME::Base64 and utf8 sampler page when I came across this. It seems that the parrot MIME Base64 library can't handle some UTF-8 characters as demonstrated below."</i>
<pre>
.sub go :main
load_bytecode 'MIME/Base64.pbc'
@rurban
rurban / perl6advent-2012-11.html
Created December 10, 2012 23:56
Day 11 - Parrot threads
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Parrot threads</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:[email protected]" />
</head>
<body style="background-color: white">
@rurban
rurban / gist:9191540
Created February 24, 2014 16:25
fixup perl5 smueller/fewer_listops3
commit eee398c1fd66c1434f722ea288ec779be2380722
Author: Reini Urban <[email protected]>
Date: Mon Feb 24 10:24:56 2014 -0600
fixup: op.c:11163:5: -Wdeclaration-after-statement
op.c: In function ‘S_null_listop_in_list_context’:
op.c:11163:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
OP *kid = cLISTOPo->op_first;
cil:
$ git checkout develop && git pull && ./configure
Already on 'develop'
Your branch is up-to-date with 'origin/develop'.
Already up-to-date.
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
@rurban
rurban / control.pm
Last active August 29, 2015 13:57
rakudo: parrot openpipe with rurban/openpipe-env-gh1065
sub QX($cmd) {
#if? parrot
my $pipe := pir::new__Ps('FileHandle');
my $env := pir::new__Ps('Env');
$pipe.set_keyed('env', $env);
$pipe.open(nqp::unbox_s($cmd), 'rp');
fail "Unable to execute '$cmd'" unless $pipe;
$pipe.encoding('utf8');
my $result := $pipe.readall;
@rurban
rurban / gist:9605884
Last active August 29, 2015 13:57
rakudo 1aeb7c3
What could this be?
./perl6-p --setting=NULL --optimize=3 --target=pir --stagestats --output=src/gen/p-CORE.setting.pir gen/parrot/CORE.setting
Stage start : 0.000
Error while compiling, type X::Undeclared::Symbols
post_types: Hash<5920886953964591723>
unk_types: Hash<5920886953964600947>
unk_routines: Hash<5920886953964564843>
routine_suggestion: Hash<5920886953964562799>
type_suggestion: Hash<5920886953964569977>