This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
needs struct' | |
with struct' | |
: clone' ( a-a ) here 2dup swap size dup push allot pop copy ; | |
{ 2 fields .name .personal-dict } user | |
: ;parse ( "-$ ) '; accept tib keepString ; | |
: name: ( a"- ) ;parse swap .name ! ; | |
user luke | |
luke name: Luke Parrish; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
needs decimal' | |
with decimal' | |
: sqr ( n-n ) dup * ; | |
3 elements i j sum | |
1 !i 1 !j 0 !sum | |
8 !scale | |
: // ( nn-n ) push 100000000 * pop / ; | |
: pi_series ( -) repeat @j @i // @sum + !sum 4 @sum * yield @i 2 + !i @j -1 * !j again ; | |
3 elements s0 s1 s2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( generator ) | |
{{ | |
: xt, ( - ) 1 , @last @d->xt , ; | |
---reveal--- | |
: yield ( - ) 1 , here 5 + , xt, [ :is ] , 9 , xt, [ :devector ] , ; | |
compile-only | |
}} | |
: foo ( - ) "State one" puts yield | |
"State two" puts ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import IO | |
-- IO playground | |
intro :: String | |
intro = "Hello, welcome to the playground." | |
prompt = "\n->" | |
-- | |
quit :: IO () | |
quit = do putStr "\nGoodbye." | |
loop :: IO () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Idea: Digital commodity that acts as a source of credit and currency exchange. | |
Bitcoin already provides a good way of creating a chain of digital transactions that can't easily be faked. This kind of transaction could be tied to something more elaborate. Among the possibilities, a distributed system for generating currency in a manner that is similar to a loan against collateral. | |
1. Alice generates a hard hashes against genesis block containing her public key. | |
2. Bob (and everyone) verifies that they are indeed hard and against the genesis block. | |
3. Alice sends Claire a transaction signed with her public key. | |
4. Bob verifies that the transaction is signed by someone with Alice's (i.e. the hard hash solver's) public key. | |
So far, I'm describing bitcoin. However additional rules can be added to enable conversions like this: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir ~/bzr | |
cd ~/bzr | |
bzr branch lp:retro-language | |
mkdir ~/github | |
mkdir ~/github/retro-language | |
cd ~/github/retro-language | |
git init | |
bzr fast-export --plain ~/bzr/retro-language/ | git fast-import | |
git checkout master | |
git remote add origin https://github.com/lsparrish/retro-language.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Idea: Liquid nitrojen jet cutter for CNC | |
This would be a novel form of CNC. Instead of waterjet, use liquid nitrogen. | |
A small high-tensile canister full of LN2 would be equipped with a small nozzle at the bottom, which would eject a high-speed burst of liquid nitrogen. Pressure would come from gas build-up in the top from boiling. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#==========Bitzap: a tiny bitcoin-like program.==========# | |
# The goal is secure published transactions. Not yet completed. | |
# Install Notes: | |
# Uses dbdict, a recipe from: http://code.activestate.com/recipes/576642-persistent-dict-with-multiple-standard-file-format/ | |
# On Ubuntu the Crypto library can be installed with "sudo apt-get install python-crypto" | |
# Details: | |
# Addresses are first 32 chars of a hash of the public key. | |
# Transaction IDs are first 32 chars of the buyer's signature. | |
# Receipts are lists of debits and credits that have been applied to each address. | |
# Buyer is sender, seller is receiver. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chain: struct' | |
: { ( -n ) 0 ; | |
: field ( nn"-n ) over ` : .data ` + ` ; + ; | |
: } ( n"- ) ` : .data ` here ` swap ` allot ` constant ` ; ; | |
: clone ( a-a ) here swap 3 + @ allot ; | |
;chain | |
with struct' | |
{ | |
2 field .bar | |
1 field .baz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chain triggers' | |
{{ | |
variable dict | |
: m dup 0 =if nip 0 ;then 2dup 1+ @ =if nip 2 + 0 ;then ; | |
: n here dict @ , dict ! , ; | |
: ? dict repeat @ m 0; again ; | |
---reveal--- | |
: __? @ ? 0; .word ; parsing | |
: > compiler off 9 , key dup emit n 8 , , ; compile-only | |
: < here compiler on ; |