A Go version of The Perl Cookbook
The Perl part is copyrighted by O'Reilly & Associates yet freely available.
This copy is based on http://pleac.sourceforge.net/pleac_perl.data
export memory memory(initial: 2, max: 0); | |
global g_a:int = 65536; | |
table T_a:funcref(min: 12, max: 12); | |
data d_syncunlockofunlockedMutexinv(offset: 65536) = | |
"\08\00\01\00\1e\00\00\00sync: unlock of unlocked Mutexinvalid syntaxre" | |
"flect: call of reflect.Type. on invalid typeTreflect: call of reflect." | |
"Value. on invalid type/proc/self/exeout of memorypanic: runtime error:" |
unit dvga; | |
{$G+} { generate 286 instructions -- needed for shl 6/8 } | |
{ for rect, should I inline the hline routine, | |
and convert the rest to asm? } | |
interface | |
const | |
maxx=319; | |
maxy=199; |
.model tiny | |
.radix 16 | |
.data | |
jmp start | |
;k1 dw 6255 | |
;k2 dw 3619 | |
k1 dw 24CD | |
k2 dw 1 | |
seed dw ? |
From: Ian Lance Taylor | |
After many discussions and reading many comments, we plan to move | |
forward with some changes and clarifications to the generics design | |
draft. | |
1. | |
We’re going to settle on square brackets for the generics syntax. | |
We’re going to drop the “type” keyword before type parameters, as |
<dgryski@kamek[powbench] \ʕ◔ϖ◔ʔ/ > go test -test.bench=. | |
BenchmarkPolyPow-4 5000000 286 ns/op | |
BenchmarkPolyFast-4 100000000 16.7 ns/op | |
PASS | |
ok github.com/dgryski/powbench 3.430s |
// +build gofuzz | |
package viaproxy | |
import ( | |
"bytes" | |
"io" | |
"net" | |
) |
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
my $bin=$ARGV[0]; | |
my @line = split /\s+/, `nm $bin |grep runtime.buildVersion`; | |
my $addr = hex($line[0]); | |
my $end = $addr + 16; |
A Go version of The Perl Cookbook
The Perl part is copyrighted by O'Reilly & Associates yet freely available.
This copy is based on http://pleac.sourceforge.net/pleac_perl.data
laptop:cppgo dgryski$ cat gen.go | |
package main | |
//go:generate cpp-7 -E -P foo.gopp foo.go | |
laptop:cppgo dgryski$ cat foo.gopp | |
package main | |
import "fmt" | |
#define STRINGIFY(x) #x |
<dgryski@kamek[go] \ʕ◔ϖ◔ʔ/ > ag '// [A-Z]+(\([^\)]*\))?: ' |sed 's/.*\/\/ //; s/:.*//; s/(.*)/(username)/' |sort |uniq -c |sort -n | |
1 ARM | |
1 ASCII | |
1 BP | |
1 BX | |
1 CAVEAT | |
1 D | |
1 DATABUNDLE | |
1 DATABUNDLEEND | |
1 EXCEPT |