Skip to content

Instantly share code, notes, and snippets.

View zhuomingliang's full-sized avatar

Jimmy Zhuo zhuomingliang

  • Gan Zhou, China
View GitHub Profile
@zhuomingliang
zhuomingliang / timeline.md
Created September 10, 2011 04:01 — forked from pmichaud/timeline.md
General timeline of subsystem changes for Dukeleto

Dukeleto asked me to put together a general timeline or checklist of changes that we need to make to Parrot, organized by size and scope of the work, the effort required, and the relative ordering that (I think) is a pretty good way to go about it.

This isn't an "official" timeline or anything like that. It's just my own personal idea for what we should probably be doing, and how hard it will be to do. The items below are listed in a quasi-chronological order in the sense that, left to my own devices, I will probably approach these problems myself in this order. Other people are welcome to tackle things in any order, so

@zhuomingliang
zhuomingliang / foo.c
Created November 28, 2011 13:25 — forked from jnthn/foo.c
#include <stdio.h>
#include <stdlib.h>
__declspec(dllexport) void Argless()
{
printf ("Hello from argless function!\n");
}
__declspec(dllexport) void GotValues(int x, float y, char *z1)
{
@zhuomingliang
zhuomingliang / parrot.h
Created February 6, 2012 16:12 — forked from gerdr/parrot.h
Parrot object model refactor proposal
#ifndef PARROT_H_
#define PARROT_H_
#include <stddef.h>
// short names so we don't have to type Parrot_ everywhere
#define PInt Parrot_Int
#define PNum Parrot_Num
// ...
sub logic { first {! try .()}, @_ }
for 1,2,3 X 1,2,3 -> $x, $y {
logic { $x > 2 },
{ $x + $y == 5 },
{ $y < 3 },
{ say "$x + $y == 5"; Nil }
}
constant @primes = 2, 3, -> $p { ($p+2, $p+4 ... -> $n { $n %% none @primes ... * >= sqrt $n })[*-1] } ... *; say @primes[^20];
@zhuomingliang
zhuomingliang / gist:2500410
Created April 26, 2012 15:34 — forked from Benabik/gist:2500370
GSoC Proposal: 6model Integration

6model Integration

Short Description

6model is the object model created for Rakudo Perl 6 and the newest iteration of the NQP lanugage. It appears to be more flexible than the PMC object model. This project is an attempt to integrate 6model into the core of Parrot.

Project Description

use v6;
role Signal {
has @.slots; # a nice list of callbacks (that are methods)
multi method connect(Any:D $sender, Any:D $rcpt, Method $method){
@.slots.push([$sender, self, $rcpt, $method]);
}
multi method connect(Any:D $rcpt, Method $method){
@zhuomingliang
zhuomingliang / questions.txt
Created May 7, 2012 11:18 — forked from cotto/questions.txt
m0 memory questions
per-callframe constants segment layout:
constants segment starts with a list of fixed-width pointers. I/N entries are stored directly. S/P entries are pointers to later in the constants segment
The data segment has a couple options. It can be appended after the constants segment (either on the next page or immediately after), with the constants data being marked read-only. Alternately, it can just be another segment attached to a special register.
If callframes are analogous to subs, the constants and data segment can be analogous to lexical data.
If callframes are analogous to subs, how will recursion work?
* clone a callframe (when? before entering ( -> no state) or after entering (less waste, leftover state))
* need to work out calling conventions
@zhuomingliang
zhuomingliang / gist:2706999
Created May 16, 2012 03:07 — forked from nbrown/gist:2706968
M0 Debugger idea

Debugger:

Use the same m0 run loop and ops as m0 proper

The debugger main function, should be called from m0 proper should have the same signature as m0 ops

Store all state data in a debugger state struct

The struct has the following fields:

  • Run state => an enumerated value which is initialized to STEP. The valid values for the enumeration are:
  • STEP => which means the debugger will execute a single iteration of the
@zhuomingliang
zhuomingliang / starry.pl
Created May 21, 2012 14:23 — forked from moritz/starry.pl
Starry obfu v1.1
+"(*+*)*(*+* +*/*) **** ** * * *+*+*/* **** ** * *
*+*-*/* **** ** * * *+* ****-* **** ** * * *-(*-*/
*) ** (*+*/*) **** ** * * *-* **** ** * * *-*+*/*
**** ** * * *+* **** ** * * *-* * * ***((* - */*)
** * * *-*/*) * * **** ** * * *+*/* ****-* ***(*-*
/*)**(*+*/*) * * ***((*-*/*)** * * *-*/*) * * ****
** * * *+*/* **** ** * * *+*+*/*-* * *".split(<***>
).map: {.(|(<* * *>xx.count)).chr.print given eval
"(* ** *+*+*-*/*+$_)" }