Skip to content

feat: implement await match for multi-future select with heterogeneou…#9

Open
Azer0s wants to merge 12 commits intomainfrom
feat/await-match
Open

feat: implement await match for multi-future select with heterogeneou…#9
Azer0s wants to merge 12 commits intomainfrom
feat/await-match

Conversation

@Azer0s
Copy link
Copy Markdown
Owner

@Azer0s Azer0s commented Apr 3, 2026

…s types

Azer0s added 12 commits April 3, 2026 23:06
…s suppression

Warning now only fires when ALL case arms have guards and there is no default arm.
Includes line:col in warning output. -Wno-await-match-guards suppresses it.
Also replaces yield with sleep(1) in await_match.tin to exercise real blocking.
ioutil: add FdReader/FdWriter adapters to eliminate duplicated _fd_impl
functions; all operations now have a single implementation. write_string
and write_bytes now retry partial writes consistently for all backends.

udp: mirror TCP structure with Server.accept(max_n) returning Conn;
Conn carries received datagram in .data and peer address in .host/.port;
write is overloaded for both [byte] and *byte (AsyncWriter); host string
now constructed in C via TinString* to remove manual buffer management
from Tin code.

examples: udp_echo_server simplified to 7 lines; unix_echo_server drops
unused 'use io'.

docs: add array pattern matching to 02-control-flow, await match to
14-fibers, new stdlib/networking.md covering io/ioutil/tcp/udp/unix.
…, remove tin_head binary

recv_from_impl used mem::malloc(65536) and mem::free to manage the datagram
receive buffer. Replace with let buf [byte; 65536] which is a fixed-size array
managed by the coroutine frame - no manual allocation or free needed.

Also removes the accidentally committed tin_head ELF binary (6.8 MB).
- Updated UDP echo server to read and echo back strings instead of raw bytes.
- Improved regex match handling by adding begin offsets for captured groups.
- Refactored memory management in regex functions to use `mem::malloc` and `mem::free`.
- Added support for 8-bit type formatting in documentation.
- Enhanced error handling in regex compilation and execution.

Signed-off-by: Ariel Simulevski <ariel@simulevski.at>
@Azer0s Azer0s force-pushed the feat/await-match branch from 81c6ef5 to 97bc0c7 Compare April 4, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant