Skip to content

Instantly share code, notes, and snippets.

View devyn's full-sized avatar
👨‍💻
Nushell is really cool

Devyn Cairns devyn

👨‍💻
Nushell is really cool
View GitHub Profile
// With async
function foo(callback) {
async.series([
function (done) {
one("x", done);
},
function (done) {
if (FOO) {
two("y", done);
@devyn
devyn / gist:d2b69e8c264ef7639f10
Last active August 29, 2015 14:27
Kit shell pseudocode
1 > logger = !LogInput
[3414] logger
2 > logger.send({key: "value"})
logger: Received {key: "value"} from 2929
3 > !Echo
Error: Must assign spawned process to variable
4 > echo = !Echo
5 > echo.send(1234)
6 > echo.recv()
1234
@devyn
devyn / gist:d9ff282df07a27b50325
Created October 29, 2014 06:52
Textual redstone
nor(out, A, B) {
out !- A + B;
}
nand(out, A, B) {
notA !- A;
notB !- B;
out <- notA + notB;
}
implementation console trace[] Hi @#two;
infrastructure affix[] [ foo[] a b c d [two: implementation console explode[] Yo!] ];

Ordering guarantees in Paws

New call-pattern

Caller should own itself.

  1. Clone the subject.
  2. Request ownership for the subject clone over itself.
  3. Request ownership for the subject clone over caller.
  4. Stage subject clone with message. Can not realize until next step due to
==1071== Memcheck, a memory error detector
==1071== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==1071== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==1071== Command: build/libpaws-tests
==1071==
==1071== Conditional jump or move depends on uninitialised value(s)
==1071== at 0x525332: terminfo::parser::compiled::parse::h585454ead94a4ccfLAa (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
==1071== by 0x53624E: terminfo::TerminfoTerminal$LT$T$GT$.Terminal$LT$T$GT$::new::h16534774972133198398 (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
==1071== by 0x535BA6: stdout::hcef6206484deeb69ahc (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
==1071== by 0x4D3566: run_tests_console::h78b6f57265fba520uFc (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
build/libpaws-tests: src/lib/paws.rs src/lib/cpaws/mod.rs src/lib/cpaws/tests.rs src/lib/object/mod.rs src/lib/object/cache/mod.rs src/lib/object/cache/tests.rs src/lib/object/members.rs src/lib/object/tests.rs src/lib/nuketype/mod.rs src/lib/nuketype/thing/mod.rs src/lib/nuketype/symbol/mod.rs src/lib/nuketype/symbol/tests.rs src/lib/nuketype/execution/mod.rs src/lib/nuketype/execution/tests.rs src/lib/nuketype/alien/mod.rs src/lib/nuketype/alien/tests.rs src/lib/nuketype/locals/mod.rs src/lib/nuketype/locals/tests.rs src/lib/script/mod.rs src/lib/machine/mod.rs src/lib/machine/reactor/mod.rs src/lib/machine/reactor/mock.rs src/lib/machine/reactor/serial.rs src/lib/machine/reactor/parallel.rs src/lib/machine/reactor/tests.rs src/lib/machine/tests.rs src/lib/system/mod.rs src/lib/system/infrastructure/mod.rs src/lib/system/infrastructure/label/mod.rs src/lib/system/infrastructure/execution/mod.rs src/lib/system/implementation/mod.rs src/lib/system/implementation/console/mod.rs src/lib/system/implementation/te
==27455== Memcheck, a memory error detector
==27455== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==27455== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==27455== Command: build/libpaws-tests
==27455==
==27455== Conditional jump or move depends on uninitialised value(s)
==27455== at 0x501BB8: parse_opts::h7a5697aaa83f35aepFb (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
==27455== by 0x50176D: test_main::hee3771f43c4320c6rvb (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
==27455== by 0x50C6E0: test_main_static::hf8903d13bd63fd87czb (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
==27455== by 0x4C9723: __test::main::h27d4f9fac1d9661cGim (in /home/devyn/Projects/devyn/Paws.rs/build/libpaws-tests)
Program received signal SIGILL, Illegal instruction.
0x00000000005de790 in oom::h851da21fdca0457fqPa ()
(gdb) backtrace
#0 0x00000000005de790 in oom::h851da21fdca0457fqPa ()
#1 0x000000000054bbe8 in vec::alloc_or_realloc::h10413476331709191326 ()
#2 0x000000000054baed in vec::Vec$LT$T$GT$::reserve_additional::h4477054561224967768 ()
#3 0x000000000054e486 in getopts::h89a0a314f224adf9Jgb ()
#4 0x00000000004caba2 in parse_opts::h7a5697aaa83f35aepFb ()
#5 0x00000000004ca6ee in test_main::hee3771f43c4320c6rvb ()
#6 0x00000000004d5661 in test_main_static::hf8903d13bd63fd87czb ()
infrastructure execution stage[]
[infrastructure affix[] [locals]] [infrastructure empty[]];
infrastructure execution stage[]
[infrastructure set[]
[infrastructure get[] [locals] [infrastructure length[] [locals]]]
1] self.portrait;
infrastructure execution stage[]