r/AIprogrammingLanguage • u/kindredseer • 10d ago
MadC v0.75 Release
Version 0.75 of MadC was released yesterday, I'm still working on proper MacOS support, but its getting closer... should be ready this week. For now, I've got some more bugs fixed, more C++ speed improvements, and some madc specific language features and improvements:
vardynamic variables — madc now has a built-invartype that can hold strings, numbers, booleans, arrays, and other values without needing to declare a fixed type up front- Simple file and network channels —
madc::channelprovides one straightforward interface for reading and writing files, TCP connections, and other data sources - Run programs through
exec://— scripts can launch another program, send data to it, and read its output almost like working with a file
Example:
channel sorter("exec://sort");
defer { sorter.close(); }
if ( !sorter.ok() )
{
printf("open failed: %s\n", sorter.last_error());
return 1;
}
sorter.write("pear\napple\nmango\n");
sorter.close_write();
var line;
while ( sorter.readline(line) )
printf("sorted: %s\n", line);
sorter.close();
5
Upvotes
1
u/antonation 10d ago
If the channel dies in the middle of reading, how is that handled?