Commit Graph

242 Commits

Author SHA1 Message Date
gingerBill
99e6eba20f Revert demo.odin 2020-05-23 13:57:45 +01:00
gingerBill
7d11ee605c Add sort.binary_search (uses interpolation sort for ordered numeric types) 2020-05-23 13:57:24 +01:00
gingerBill
aa029fe8d9 Add "pure" procedure types 2020-05-23 13:38:06 +01:00
gingerBill
fd6e2ed5de Revert demo.odin 2020-05-22 14:56:32 +01:00
gingerBill
7bd1039a49 Selector Call Expressions: x->y(123) == x.y(x, 123) 2020-05-22 14:54:30 +01:00
gingerBill
e1bdaa981a Relative pointer and relative slices 2020-05-15 18:45:24 +01:00
gingerBill
e0a242e9a1 Enforce explicit context definition for procedure calls 2020-05-14 13:44:28 +01:00
gingerBill
9524739dfc Revert demo.odin 2020-03-19 15:31:05 +00:00
gingerBill
3d81ad46d2 Change demo.odin to default 2020-03-19 15:29:32 +00:00
gingerBill
93955a0fd8 Remove context.std* parameters; Fix unary boolean not 2020-03-19 15:03:02 +00:00
gingerBill
28502ba53b Fix context system; add more to -show-more-timings for LLVM API; Add ODIN_USE_LLVM_API global constant 2020-03-08 12:34:36 +00:00
gingerBill
8dc74a004c Fix nested type declarations name generation, to be internally consistent 2020-03-08 11:46:05 +00:00
gingerBill
c584456a21 Fix logical binary expressions 2020-03-08 10:43:00 +00:00
gingerBill
f92334a769 Basic functionality, except for map and correct nested typename mangling 2020-03-07 10:38:14 +00:00
gingerBill
8d2ad0da0e Fill in more of the llvm_backend code generation 2020-03-05 22:01:07 +00:00
gingerBill
e1da631d26 General functionality without context 2020-03-04 22:09:58 +00:00
gingerBill
b13423d7f7 Global variable initialization support 2020-02-23 16:25:11 +00:00
gingerBill
2180f4a475 Basic work on obj generation 2020-02-23 10:04:25 +00:00
gingerBill
35711a400c Anonymous procedure literal support 2020-02-08 12:49:38 +00:00
gingerBill
0103cedad7 Port code for lb_build_call_expr 2020-02-02 23:36:15 +00:00
gingerBill
d56807095a Implement constant value generation from ExactValue 2020-02-02 18:33:13 +00:00
gingerBill
5dc82c2720 Correctly generate LLVM types from Odin types. 2020-02-02 12:34:49 +00:00
gingerBill
6ed6a91a64 Begin LLVM C API integration 2020-02-01 22:50:57 +00:00
gingerBill
0f399a7294 Add union #maybe 2020-02-01 11:10:28 +00:00
gingerBill
159150c6d9 Allow not_in as keyword over notin, but still allow notin to work 2020-01-16 10:00:14 +00:00
gingerBill
3bd00fd6b7 Add thread.Pool with example in demo.odin; Update linalg to support handness changes for projection matrices 2020-01-02 15:07:12 +00:00
gingerBill
bdfef08214 Fix typos in demo.odin 2019-12-31 12:54:19 +00:00
gingerBill
5ec8dd166a Add #partial tag for enumerated arrays to prevent common errors using non-contiguous enumerations 2019-12-27 16:55:32 +00:00
gingerBill
f99f351e01 Add constant literal expressions 2019-12-27 15:49:52 +00:00
gingerBill
d1c9fd4e01 Implement #complete switch by default, replace with #partial switch #511 2019-12-22 12:03:48 +00:00
gingerBill
89ccb5b99f Add assert into scratch_allocator_proc to prevent initialization cycles #504 2019-12-15 11:20:06 +00:00
gingerBill
7fbe0a6f23 Fix nil comparisons for soa slices and dynamic arrays 2019-12-01 11:56:08 +00:00
Tetralux
99121d6ff2 Implement core:thread and core:sync on Unix using pthreads
Also do some cleanup and refactoring of the thread, sync and time APIs.

- remove 'semaphore_release' because 'post' and 'wait' is easier to understand

- change 'semaphore_wait' to '*_wait_for' to match Condition

- pthreads can be given a stack, but doing so requires the user to set up the guard
  pages manually. BE WARNED. The alignment requirements of the stack are also
  platform-dependant; it may need to be page size aligned on some systems.
  Unclear which systems, however. See 'os.get_page_size', and 'mem.make_aligned'.
  HOWEVER: I was unable to get custom stacks with guard pages working reliably,
  so while you can do it, the API does not support it.

- add 'os.get_page_size', 'mem.make_aligned', and 'mem.new_aligned'.

- removed thread return values because windows and linux are not consistent; windows returns 'i32'
  and pthreads return 'void*'; besides which, if you really wanted to communicate how the
  thread exited, you probably wouldn't do it with the thread's exit code.

- fixed 'thread.is_done' on Windows; it didn't report true immediately after calling 'thread.join'.

- moved time related stuff out of 'core:os' to 'core:time'.

- add 'mem.align_backward'

- fixed default allocator alignment
  The heap on Windows, and calloc on Linux, both have no facility to request alignment.
  It's a bit of hack, but the heap_allocator now overallocates; `size + alignment` bytes,
  and aligns things to at least 2.
  It does both of these things to ensure that there is at least two bytes before the payload,
  which it uses to store how much padding it needed to insert in order to fulfil the alignment
  requested.

- make conditions more sane by matching the Windows behaviour.
  The fact that they were signalled now lingers until a thread tries to wait,
  causing them to just pass by uninterrupted, without sleeping or locking the
  underlying mutex, as it would otherwise need to do.
  This means that a thread no longer has to be waiting in order to be signalled, which
  avoids timing bugs that causes deadlocks that are hard to debug and fix.
  See the comment on the `sync.Condition.flag` field.

- add thread priority: `thread.create(worker_proc, .High)`
2019-12-01 00:46:23 +00:00
gingerBill
9b58781122 #soa[dynamic]Type (Experimental) 2019-11-21 19:36:07 +00:00
gingerBill
b74f8f2047 Fix SOA entity usage error on -vet 2019-11-21 18:21:27 +00:00
gingerBill
88c90cf99a Update demo.odin 2019-11-21 14:41:33 +00:00
gingerBill
400f12f31f Update demo.odin 2019-11-21 14:23:59 +00:00
gingerBill
2c5a84bb78 #soa[]Type (Experimental) 2019-11-21 00:07:21 +00:00
gingerBill
d22e5b697d Add new #soa and #vector syntax 2019-11-17 10:30:37 -08:00
gingerBill
301ee664e9 Add Handmade Seattle 2019 Demos 2019-11-16 06:59:48 -08:00
gingerBill
8a46b493fd Fix Slice passed incorrectly in LLVM IR to procedure called via procedure pointer #465 2019-11-05 19:40:08 +00:00
gingerBill
c1176c2bcb Fix typeid comparison bug; Add extra messages for pointer address errors 2019-11-03 19:49:21 +00:00
gingerBill
57853fe1b1 Add SOA Struct Layout (experimental) to demo.odin 2019-11-03 12:52:13 +00:00
gingerBill
013b3b9fb3 Fix for -vet 2019-11-03 11:42:00 +00:00
gingerBill
e3d3a81617 multivalued procedure calls allows in for in to allow a pseudo-iterator; @thread_local for variables in procedure 2019-11-02 16:36:46 +00:00
gingerBill
c7cb754514 Fix typos 2019-10-26 14:37:27 +01:00
gingerBill
a5e42a0465 Add ranged_fields_for_array_compound_literals 2019-10-26 14:36:28 +01:00
gingerBill
d808f9eccf Add range_cache.cpp 2019-10-26 14:29:04 +01:00
gingerBill
c60fb10a6a Move old demos and old stuff to /misc 2019-10-26 10:40:17 +01:00
gingerBill
2a6d9e8927 #panic; Minor change to demo.odin; Fix #assert bug at file scope 2019-10-13 12:38:23 +01:00