Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ANN] NegaPosi Compiler

0 views
Skip to first unread message

SASADA Koichi

unread,
May 10, 2005, 6:09:20 AM5/10/05
to
Hi,

I release NegaPosi Compiler 0.0.0+- on my diary page.
http://www.namikilab.tuat.ac.jp/~sasada/diary/200505.html#d10

NegaPosi is my new scripting language. Scripts written by NegaPosi
can run on ruby interpreter.

You can convert any Ruby scripts to NegaPosi scripts using NegaPosi
compiler.


Thanks,
--
// SASADA Koichi at atdot dot net
//

// Yes, it's a only joke software :)

Ryan Leavengood

unread,
May 10, 2005, 7:34:41 PM5/10/05
to
SASADA Koichi wrote:
> Hi,
>
> I release NegaPosi Compiler 0.0.0+- on my diary page.
> http://www.namikilab.tuat.ac.jp/~sasada/diary/200505.html#d10

Hahaha, I actually wrote one of these too, and was going to post it, but
darn it, you beat me to it :)

I think mine is simpler though ;)

Ryan

P.S. I'll post it later, it isn't on my current machine.


Ryan Leavengood

unread,
May 10, 2005, 11:58:21 PM5/10/05
to
Ryan Leavengood wrote:
>
> P.S. I'll post it later, it isn't on my current machine.

If anyone is interested, here is my NegaPosi generator:

def generate_np(str, width=64)
(str+"\0").gsub(/./) do |b|
("%08b"%b[0]).tr('01','-+')
end.scan(/[-+]{#{width}}|[-+]+/) do |line|
puts line.reverse.ljust(width)+'_'
end
end

It can take a parameter to output different widths (which don't affect the
processing of the NegaPosi "code.") I took a more functional approach in
this, but I suspect SASADA Koichi's is more efficient.

Ryan

Paul Battley

unread,
May 11, 2005, 5:13:17 AM5/11/05
to
Here's a (long) one-liner to do the same, taking advantage of
pack/unpack's "b" specifier:

str.scan(/.{1,8}/m).map{ |s| s.reverse
}.join.unpack('b*')[0].tr('01','-+').scan(/.{1,64}/).map{ |s| (s << ('
' * 64))[0,64]<< '_' }.join("\n")

Paul.


Paul Battley

unread,
May 11, 2005, 5:16:12 AM5/11/05
to

OK, that *was* one line before I posted it. Let's try again:

gabriele renzi

unread,
May 11, 2005, 8:46:53 AM5/11/05
to
SASADA Koichi ha scritto:

> Hi,
>
> I release NegaPosi Compiler 0.0.0+- on my diary page.
> http://www.namikilab.tuat.ac.jp/~sasada/diary/200505.html#d10
>
> NegaPosi is my new scripting language. Scripts written by NegaPosi
> can run on ruby interpreter.
>
> You can convert any Ruby scripts to NegaPosi scripts using NegaPosi
> compiler.

I was somewhat scared that it would compile to yarv bytecode :)

Dave Burt

unread,
May 11, 2005, 11:03:42 PM5/11/05
to
"gabriele renzi" <surren...@remove-yahoo.it> admitted...
> SASADA Koichi ha scritto:

>> You can convert any Ruby scripts to NegaPosi scripts using
>> NegaPosi compiler.
>
> I was somewhat scared that it would compile to yarv bytecode :)

Isn't NegaPosi going to be YARV's intermediate language?! ;-)


0 new messages