Niko Matsakis
e838edc0b3
isolate those funcs in task that can run on the c stack
2011-10-24 16:06:17 -07:00
Niko Matsakis
02d7a1e781
move sys fns into c-stack-cdecl and get_type_desc() into rusti
...
there is one test failure, stdtest/sys.rs, which inexplicably
(thus far) fails to compile because it invokes
sys::rustrt::last_os_error() instead of invoking
sys::last_os_error(). If stdtest/sys.rs is updated to invoke
the wrapper, it passes. Still tracing the source of this error.
2011-10-24 16:06:17 -07:00
Niko Matsakis
0598635bdc
migrate leak
2011-10-24 16:06:17 -07:00
Niko Matsakis
8eb336a705
migrate rust_run_program
2011-10-24 16:06:17 -07:00
Niko Matsakis
5ddc15e42e
migrate debugging funcs
2011-10-24 16:06:17 -07:00
Niko Matsakis
c04f42e2c7
migrate sched_threads call
2011-10-24 16:06:17 -07:00
Niko Matsakis
6910552698
convert str methods to c-stack-cdecl
2011-10-24 16:06:17 -07:00
Niko Matsakis
12ab0d66f5
make time module use c-stack-cdecl
2011-10-24 16:06:17 -07:00
Niko Matsakis
96629d5c21
move rand functions into c-stack-cdecl mode
2011-10-24 16:06:17 -07:00
Niko Matsakis
35e01e0137
remove unnecessary && from various file routines
2011-10-24 16:06:17 -07:00
Niko Matsakis
af99b4b0dc
move more native "rust" to native "c-stack-cdecl"
2011-10-24 16:06:16 -07:00
Niko Matsakis
910f7c6dd3
move io.rs natives from "rust" to "c-stack-stdlib"
2011-10-24 16:06:16 -07:00
Niko Matsakis
b13e7e0f3d
move fs routines to c-stack-stdlib
2011-10-24 16:06:16 -07:00
Niko Matsakis
4880065429
rip out unused task pointers
2011-10-24 16:06:16 -07:00
Niko Matsakis
d9b23cb022
move comm functions out of rust abi
2011-10-24 16:06:16 -07:00
Niko Matsakis
44697a4293
purge log_err
2011-10-24 16:06:16 -07:00
Niko Matsakis
e590869c8f
update vec libs to use c-stack-cdecl calling convention
2011-10-24 16:06:16 -07:00
Marijn Haverbeke
6c4c33e009
Clean up character pattern in float.rs
...
This is actually a test to see if I fixed the bot.
2011-10-21 21:06:54 +02:00
Marijn Haverbeke
6bcb4a426c
Remove last uses of iterators from stdlib
...
Issue #1056
2011-10-21 12:31:48 +02:00
Marijn Haverbeke
4ebbbe597e
Move hash table iteration over to block-taking functions
...
Issue #1056
2011-10-21 12:21:27 +02:00
Brian Anderson
ebc61e39d7
Remove temporary fn# syntax
2011-10-20 20:34:04 -07:00
Brian Anderson
29ad3bdb10
Make fn denote a bare function. Convert fn to fn@ as needed
2011-10-20 18:23:48 -07:00
Brian Anderson
686d6a485f
Drop the 2 from the spawn*2 functions
...
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
e0bba33caa
Rename std::task::spawn_inner to unsafe_spawn_inner
...
Delete the rest of the old, unused spawn functions.
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
446aea11d0
Stop exporting unsafe spawn functions
...
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
3b54dcfa79
Convert the test runners to typesafe spawn
...
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
1abebf042a
Convert std::aio to new spawn functions
...
Issue #1022
2011-10-20 18:23:47 -07:00
Brian Anderson
4341e50e3a
Add safe versions of spawn using bare functions
...
Currently they just wrap the unsafe versions. Will need to be rewritten
eventually.
Issue #1022
2011-10-20 18:23:47 -07:00
Marijn Haverbeke
457683c7fe
Do not pass taskpointers to "rust" native functions
...
Issue #466
2011-10-20 14:22:17 +02:00
Marijn Haverbeke
71a4a66135
Add a math module to the standard lib
...
I need some rudimentary stdlib stuff for the tutorial.
Closes #1042
2011-10-18 13:54:35 +02:00
Marijn Haverbeke
3cabe7429f
Add a print and println to std::io
2011-10-18 13:06:47 +02:00
Brian Anderson
b61578e1cd
Don't unify from mutable? to immutable
...
Immutable is supposed to be a subtype of mutable-huh.
2011-10-17 16:36:49 -07:00
David Rajchenbach-Teller
454333368c
[Lib] int.rs, uint.rs: added max_value, min_value
2011-10-17 11:22:57 -07:00
David Rajchenbach-Teller
064f9dd93e
[Lib] uint.rs: +min_value
2011-10-17 11:22:57 -07:00
David Rajchenbach-Teller
a85e035038
[Lib] rand.rs: type rng now defines next_float
2011-10-17 11:22:57 -07:00
David Rajchenbach-Teller
eba88ef3ea
[Lib] u32.rs: created
2011-10-17 11:22:57 -07:00
David Rajchenbach-Teller
27ca86a853
[Lib] u8.rs, u64.rs: +min_value, max_value
2011-10-17 11:22:57 -07:00
Brian Anderson
6e67c4b253
Cleanse usage of some unsafe functions on win32
2011-10-12 16:42:13 -07:00
Niko Matsakis
e8a0e592da
reimplement some of the unsafe stuff which got lost
...
- blocks inherit unsafety
- remove the --check-unsafe flag
- add unsafe annotations where needed to get things to compile
2011-10-12 16:33:07 -07:00
Niko Matsakis
046ca827dd
Add unsafe blocks, unsafe functions, and two rudimentary tests
...
related to them
2011-10-12 14:26:47 -07:00
Niko Matsakis
29584cc5ac
Extend the unchecked block stuff to allow unsafe blocks as well.
2011-10-12 14:26:47 -07:00
David Rajchenbach-Teller
8c9dd54ded
[Renaming] str_to_float is now float::from_str, float_to_str is now float::to_str
2011-10-12 10:56:05 +02:00
David Rajchenbach-Teller
7faed3d87c
[Fix] float.rs: str_to_float reimplemented
2011-10-12 10:56:05 +02:00
David Rajchenbach-Teller
3219c40e18
[Optim] int.rs: reimplemented pow with fast exponentiation
2011-10-12 10:56:05 +02:00
David Rajchenbach-Teller
2ec85135e2
[Move] Moved str_to_float, float_to_str from compiler to lib
2011-10-11 16:41:34 +02:00
Marijn Haverbeke
33167f7dec
Adjust function signatures to allow for vecs being immediate
...
Some code was relying on vectors being implicitly by-reference (as
non-immediate value). This adds the necessary &&-sigils.
Closes #1021
2011-10-10 16:01:51 +02:00
Marijn Haverbeke
b4bae8fea5
Make vectors and strings immediates again
...
There's no good reason to force them to be spilled anymore. Some
pieces of trans become more elegant this way, and less stack allocs
and load/stores are needed.
Issue #1021
2011-10-10 15:59:16 +02:00
Marijn Haverbeke
fe916fb9f0
Give up on providing a by-value version of map, convert fold over to
...
passing pointers by ref
Issue #1008
2011-10-07 09:56:12 +02:00
Marijn Haverbeke
f9fbd86f52
Parse and typecheck by-value and by-ref arg specs
...
Add sprinkle && throughout the compiler to make it typecheck again.
Issue #1008
2011-10-07 09:09:50 +02:00
Brian Anderson
04e89af6db
Add std::str::contains
2011-10-06 16:08:44 -07:00
Patrick Walton
cf3e7f2f0b
stdlib: Add a void type
2011-10-05 16:33:17 -07:00
Brian Anderson
82ef8519c3
Fix some path handling in std::fs on win32
2011-10-05 16:21:55 -07:00
Brian Anderson
a8ce543dc9
Add std::os::get_exe_path
...
Need this to correctly determine sysroot in rustc
2011-10-04 21:35:06 -07:00
Brian Anderson
a0a4d34e14
Add std::ctypes
2011-10-04 21:35:06 -07:00
Brian Anderson
6f5a0c7500
Add std::fs::normalize
2011-10-04 21:22:03 -07:00
Brian Anderson
51ae30287b
Add std::fs::split
2011-10-04 20:18:04 -07:00
Patrick Walton
0e5ea4d64f
Revert "stdlib: Migrate rust_file_is_dir() over to the C stack, and add a void type" due to build bustage on Windows
...
This reverts commit 9698ef89a0
.
2011-10-04 18:24:30 -07:00
Patrick Walton
9698ef89a0
stdlib: Migrate rust_file_is_dir() over to the C stack, and add a void type
2011-10-04 18:20:22 -07:00
Patrick Walton
af60cf407c
rt: Switch the AIO stuff to the C stack
2011-10-04 12:08:06 -07:00
Brian Anderson
0148daa058
Reorganize structure of build directory
...
Each stage is organized more according to Unix standards and to
accommodate multiple target architectures.
stageN/
bin - rustc lives here
lib - libraries that rustc needs
lib/rustc/$(target_triple/ - target libraries
2011-09-29 22:58:33 -07:00
Patrick Walton
5b6dbcb030
stdlib: Un-export str::buf; add a comment
2011-09-29 18:36:27 -07:00
Patrick Walton
dd7ff8dee4
stdlib: Export str::buf
2011-09-29 17:58:51 -07:00
Patrick Walton
6dece91ed3
stdlib: Add vec::eachi to the standard library
2011-09-29 17:34:49 -07:00
Brian Anderson
381205b747
Revert "Revert "Implement pattern ranges for all numeric types.""
...
This reverts commit a034f87146
.
Conflicts:
src/comp/middle/check_alt.rs
src/comp/middle/trans_alt.rs
src/comp/syntax/ast.rs
src/comp/syntax/ast_util.rs
src/comp/syntax/fold.rs
src/comp/syntax/print/pprust.rs
Conflicts:
src/comp/middle/trans_alt.rs
2011-09-28 12:46:29 -07:00
Brian Anderson
b8bb663df7
Don't ever raise unique kinds of pinned kinds to shared (again)
...
So *resource, ~resource, [resource] are all pinned. This is counter to the
design of the kind system, but this way is a much clearer path to type safety.
Once we've established a good baseline with lots of tests, then we can try to
make raising pinned kinds work.
2011-09-27 16:03:10 -07:00
Brian Anderson
6b42ad5ea0
Enforce copy restrictions on let initializers
2011-09-26 22:00:15 -07:00
Patrick Walton
47e5ab093a
stdlib: Fix typos in comments in lib/test.rs
2011-09-26 16:59:15 -07:00
Jesse Ruderman
48c2c9b3a7
Mark vec::len as pure
2011-09-24 15:10:03 -07:00
Brian Anderson
856acbf66d
Vectors containing pinned kinds become pinned
...
Otherwise they could be copied
2011-09-24 12:36:51 -07:00
Jesse Ruderman
3a7a2943dd
Add vec::filter
2011-09-23 19:10:48 -07:00
Marijn Haverbeke
a034f87146
Revert "Implement pattern ranges for all numeric types."
...
This reverts commit ce0f054f9d
.
2011-09-21 18:42:09 +02:00
Josh Matthews
ce0f054f9d
Implement pattern ranges for all numeric types.
2011-09-21 09:36:12 +02:00
Patrick Walton
d9c664e3fa
Revert "Revert "Make option::get return the option contents by reference" due to memory corruption"
...
This reverts commit d1c27ba9e0
.
2011-09-16 12:20:06 -07:00
Tim Chevalier
994beca00d
Add unreachable() fn, also nitpicking
2011-09-15 19:51:27 -07:00
Graydon Hoare
c94e612ade
Begin sketching an ICU binding. Doesn't work yet.
2011-09-15 15:49:17 -07:00
Patrick Walton
d1c27ba9e0
Revert "Make option::get return the option contents by reference" due to memory corruption
...
This reverts commit fc0bf12516
.
2011-09-15 12:52:09 -07:00
Marijn Haverbeke
fc0bf12516
Make option::get return the option contents by reference
...
I can't believe this actually works!
2011-09-15 17:49:29 +02:00
Marijn Haverbeke
7298b8f4ba
Insert omitted semicolons for statements
2011-09-15 09:49:00 +02:00
Graydon Hoare
a4815b6742
Factor imports mindlessly.
2011-09-12 16:13:28 -07:00
Brian Anderson
393deeb06f
Merge branch 'unwind'
...
Conflicts:
src/comp/middle/trans.rs
src/comp/middle/trans_build.rs
src/lib/run_program.rs
src/test/compiletest/runtest.rs
2011-09-12 09:36:51 -07:00
Marijn Haverbeke
ca1df2b111
Pretty-print for new arg-mode syntax
2011-09-12 12:49:00 +02:00
Marijn Haverbeke
fc6b7c8b38
Reformat for new mode syntax, step 1
...
Long lines were fixed in a very crude way, as I'll be following up
with another reformat in a bit.
2011-09-12 12:04:14 +02:00
Brian Anderson
22001d1dce
Remove hack_allow_leaks
...
Happy to close the loop on this one.
Issue #236
2011-09-11 17:31:40 -07:00
Brian Anderson
a1131748c2
Add a waitpid wrapper to std::run that interprets the exit status on unix
...
This makes the result of running a program a little more uniform between unix
and windows
2011-09-11 17:31:34 -07:00
Brian Anderson
25ae3d655c
Rewrite spawn yet again
...
The motivation here is that the bottom of each stack needs to contain a C++
try/catch block so that we can unwind. This is already the case for main, but
not spawned tasks.
Issue #236
2011-09-07 10:32:58 -07:00
Brian Anderson
01b254b411
Rename istr-stuff to str in the runtime. Issue #855
2011-09-02 22:11:46 -07:00
Brian Anderson
5c49e4f4e9
Reformat. Issue #855
2011-09-02 22:11:42 -07:00
Brian Anderson
1e8200dadd
Rename std::vec::unsafe::ivec_repr to vec_repr. Issue #855
2011-09-02 15:13:41 -07:00
Brian Anderson
72c14d5a41
Eliminate const_refcount. Issue #855
2011-09-02 15:13:41 -07:00
Brian Anderson
99ee0fca67
Remove estrs and evecs from runtime. Issue #855
2011-09-02 15:13:41 -07:00
Brian Anderson
1d3eb4911a
Remove #ifmt. Issue #855
2011-09-01 18:54:06 -07:00
Brian Anderson
418d09e547
Convert all uses of #ifmt to #fmt. Issue #855
2011-09-01 18:54:03 -07:00
Brian Anderson
6972f07510
Make #fmt and #ifmt synonymous. Issue #855
2011-09-01 17:56:25 -07:00
Brian Anderson
ab6bb035e5
Rename std::istr to std::str. Issue #855
2011-09-01 17:27:58 -07:00
Tim Chevalier
1f4f8d317c
Declare a bunch of int functions as pure
2011-09-01 16:32:05 -07:00
Brian Anderson
e824775d53
Remove std::str. Issue #855
2011-09-01 16:09:15 -07:00
Brian Anderson
1b15c9e155
Remove estr conversion functions. Issue #855
2011-09-01 15:55:39 -07:00
Brian Anderson
f07a328c16
Convert rust_list_files to istrs. Issue #855
2011-09-01 15:51:47 -07:00
Brian Anderson
82634cd530
Convert rust_getcwd to istrs. Issue #855
2011-09-01 15:51:47 -07:00
Brian Anderson
8f531e769a
Convert rust_file_is_dir from estrs to cstrs. Issue #855
2011-09-01 13:16:44 -07:00
Brian Anderson
91ea2577cd
Remove a few more istr conversions. Issue #855
2011-09-01 12:14:36 -07:00
Brian Anderson
4c25d81041
Remove some uses of str_buf builtin. Issue #855
2011-09-01 12:14:35 -07:00
Brian Anderson
3fe743bc9c
Remove various istr conversions. Issue #855
2011-09-01 12:14:34 -07:00
Brian Anderson
d0c509ad1b
Remove a bunch of string builtins. Issue #855
2011-09-01 12:14:33 -07:00
Brian Anderson
a7bc386c53
Delete parts of std::str that are no longer exported. Issue #855
2011-09-01 12:14:33 -07:00
Brian Anderson
34d197de97
Remove last users of str::sbuf. Issue #855
2011-09-01 12:14:32 -07:00
Brian Anderson
b714150487
Remove more functions from std::str. Issue #855
2011-09-01 12:14:32 -07:00
Brian Anderson
6b22640a1f
Convert std::test to istrs. Issue #855
2011-09-01 12:14:31 -07:00
Brian Anderson
775b64c955
Remove the estr #fmt. Issue #855
2011-09-01 12:14:31 -07:00
Brian Anderson
a45068cf27
Convert fs::path_is_absolute internals to istrs. Issue #855
2011-09-01 12:14:30 -07:00
Brian Anderson
91f05fba11
Reexport std::str::alloc. Windows still needs this. Issue #855
2011-08-31 21:15:08 -07:00
Erick Tryzelaar
b199e9da92
Expose STDERR to rust.
2011-08-31 20:40:00 -07:00
Brian Anderson
53a9d5a1d2
Start paring down std::str. Issue #855
2011-08-31 16:24:09 -07:00
Brian Anderson
81b31429e4
Remove more uses of str from std::run. Issue #855
2011-08-31 16:24:08 -07:00
Brian Anderson
498e38b705
Convert uses of #fmt to #ifmt. Issue #855
2011-08-31 11:44:06 -07:00
Michael Sullivan
959938e891
Produce the start of an immutable treemap.
2011-08-31 14:10:15 -04:00
Brian Anderson
04928ed3f0
Add a FIXME about the bogosity of aio::ip_to_sbuf
2011-08-30 21:08:07 -07:00
Brian Anderson
c94d4cff03
Convert std::net to istrs. Issue #855
2011-08-30 21:08:07 -07:00
Brian Anderson
4c936d7992
Add #ifmt extension, like #fmt but for istrs. Issue #855
2011-08-30 21:08:07 -07:00
Brian Anderson
9e2c5f77a4
Remove the %S istr conversion from #fmt
...
I want to do the #fmt transition a different way. Issue #855
2011-08-30 21:08:07 -07:00
Tim Chevalier
9f7ed2f054
Add a total version of vec::last that has a precondition
2011-08-30 17:17:42 -07:00
Tim Chevalier
268533a920
Add a precondition on vec::zip
...
vec::zip now has the precondition that the two argument vectors
are the same length. Changed uses of it to reflect that.
Also added a few vector-enumerating utilities to vec.rs, which
necessitated in making some functions in u8 declared-pure.
2011-08-30 16:39:22 -07:00
Marijn Haverbeke
7bbe8d2e8c
Stop relying on klunky hack in alias.rs
...
It assumed node_ids increased monotonically for locals, but macros
make this no longer the case, and it was a dubious assumption anyway.
It now numbers locals itself and uses that to determine which precede
which.
2011-08-30 17:03:00 +02:00
Marijn Haverbeke
4db388ea6c
Remove obsolete exports
2011-08-29 23:46:38 +02:00
Marijn Haverbeke
b099b1e3f7
Make std::istr::push_byte efficient
...
It used to allocate two (!) heap values per pushed byte. It now goes through
a runtime function that simply grows the istr and writes the byte.
2011-08-29 22:46:49 +02:00
Marijn Haverbeke
c9c5ee252a
Implement non-internal ivecs
...
Vectors are now similar to our old, pre-internal vectors, except that
they are uniquely owned, not refcounted.
Their name should probably change too, then. I've renamed them to vec
in the runtime, will do so throughout the compiler later.
2011-08-29 09:07:53 +02:00
Brian Anderson
58dedcd090
Convert lexer to istrs. Issue #855
2011-08-27 15:54:45 -07:00
Brian Anderson
138973335a
Add std::istr::as_buf for converting to cstrs. Issue #855
2011-08-27 15:54:44 -07:00
Brian Anderson
7284f820d5
Support istrs in #fmt. Issue #855
...
The format string may be an istr and istr args may be used with %S
2011-08-27 15:54:44 -07:00
Brian Anderson
652332f9d4
Convert std::map::new_str_hash to istrs. Issue #855
2011-08-27 15:54:44 -07:00
Brian Anderson
faef9490ae
Optimize std::istr::to_estr. Issue #855
2011-08-27 15:54:44 -07:00
Brian Anderson
15e3ae7936
Convert std::os to istrs. Issue #855
2011-08-27 15:54:44 -07:00
Brian Anderson
85b4253bc1
Convert std::generic_os to istrs. Issue #855
2011-08-27 15:54:43 -07:00
Brian Anderson
ccc68fc18b
Add std::istr::str_from_cstr. Issue #855
2011-08-27 15:54:43 -07:00
Brian Anderson
fcc031c5b4
Convert std::io to istrs. Issue #855
2011-08-27 15:54:43 -07:00
Brian Anderson
20178b9312
Convert std::run to istrs. Issue #855
2011-08-27 15:53:09 -07:00
Brian Anderson
4cf2e510e0
Convert std::getopts to istrs. Issue #855
2011-08-27 15:53:09 -07:00
Brian Anderson
c2eafd268b
Convert std::fs to istrs. Issue #855
2011-08-27 15:53:09 -07:00
Brian Anderson
051f1ff562
Convert std::sha1 to istrs. Issue #855
2011-08-27 15:53:09 -07:00
Brian Anderson
bd84fbe9f3
Convert std::term to istrs. Issue #855
2011-08-27 15:53:08 -07:00
Brian Anderson
8146ca982e
Convert std::u64 to istrs. Issue #855
2011-08-27 15:53:08 -07:00
Brian Anderson
53be480d20
Convert std::int to istrs. Issue #855
2011-08-27 15:53:08 -07:00
Brian Anderson
ee2a11eb4f
Convert std::uint to istrs. Issue #855
2011-08-27 15:53:08 -07:00
Brian Anderson
69e6abf9ce
Rename std::istr::from_str/to_str to from_estr/to_estr. Issue #855
...
This will make it a bit clearer what's going on
2011-08-27 15:53:08 -07:00
Brian Anderson
2c8a93aa3b
Convert std::bitv to istrs. Issue #855
2011-08-27 15:53:08 -07:00
Eric Holk
2fab948e01
stdlib: Added a treemap traversal function.
2011-08-26 18:03:32 -07:00
Eric Holk
cd913b454d
stdlib: Added an incredibly simple treemap.
2011-08-26 18:03:32 -07:00
Tim Chevalier
b099760269
Remove remaining use of 'pred' and make 'pred' a non-reserved word. Huzzah\!
2011-08-25 22:26:45 -07:00
Tim Chevalier
d9bc3cb10c
Change "pred" to "pure fn" in all libraries and test cases
2011-08-25 18:24:45 -07:00
Eric Holk
2f7c583bc1
Cleaning up task and comm exports, updating all the test cases.
2011-08-25 11:21:25 -07:00