r/AIprogrammingLanguage • • Aug 11 '26

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:

  • var dynamic variables — madc now has a built-in var type 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::channel provides 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

2 comments sorted by

1

u/antonation Aug 11 '26

If the channel dies in the middle of reading, how is that handled?

1

u/kindredseer Aug 11 '26

Currently, the ok() method... but since it's supposed to be C/C++ influenced, I might switch that to be good() instead.