This file contains hidden or 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
| all: base64 | |
| base64: base64.dats | |
| atscc -o base64 base64.dats |
This file contains hidden or 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
| staload "contrib/task/SATS/task.sats" | |
| dynload "contrib/task/DATS/task.dats" | |
| fn do_main (sch: scheduler) = begin | |
| set_global_scheduler (sch); | |
| task_spawn (16384, lam () => begin | |
| print ("hello\n"); | |
| task_yield (); | |
| print ("world\n") |
This file contains hidden or 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
| fun foo {v:view} (pf: !v | b1: (!v | int) -<cloref> void):void = { | |
| val v = 5 | |
| val () = b1(pf | v) | |
| } | |
| implement main () = { | |
| var x: int? with pf_x | |
| viewdef V = int? @ x | |
| val () = foo {V} (pf_x | lam (pf | newval) => x := newval) | |
| val () = printf("%d\n", @(x)) |
This file contains hidden or 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
| %{^ | |
| typedef struct resource { | |
| void* data; | |
| int x; | |
| } resource; | |
| %} | |
| absviewtype data_vt (l:addr) | |
| extern fun data_vt_make (): [l:agz] (data_vt l ) = "mac#data_make" | |
| extern fun data_vt_free {l:addr} (r: data_vt l): void = "mac#data_free" |
This file contains hidden or 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
| /* | |
| Copyright (c) 2011, Chris Double | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
This file contains hidden or 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
| staload "libc/SATS/random.sats" | |
| staload "libc/SATS/unistd.sats" | |
| staload "libats/SATS/parworkshop.sats" | |
| staload "libats/DATS/parworkshop.dats" | |
| staload "prelude/DATS/array.dats" | |
| #define ITER 100000000 | |
| #define NCPU 2 | |
| fn random_double (buf: &drand48_data): double = let |
This file contains hidden or 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
| staload "libc/SATS/random.sats" | |
| staload "libc/SATS/unistd.sats" | |
| staload "libats/SATS/parworkshop.sats" | |
| staload "libats/DATS/parworkshop.dats" | |
| staload "prelude/DATS/array.dats" | |
| #define ITER 100000000 | |
| #define NCPU 2 | |
| fn random_double (buf: &drand48_data): double = let |
This file contains hidden or 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
| staload "libc/SATS/signal.sats" | |
| staload "libc/SATS/stdio.sats" | |
| staload "libc/SATS/unistd.sats" | |
| staload "libc/sys/SATS/wait.sats" | |
| staload "libc/sys/SATS/types.sats" | |
| staload "libc/sys/SATS/socket.sats" | |
| staload "libc/netinet/SATS/in.sats" | |
| staload "libc/arpa/SATS/inet.sats" | |
| staload "prelude/DATS/array0.dats" |
NewerOlder