I think that the trace function is inteded to be used only for debug, i think that's why it prints the file and the row from which you called it.
What I think you really want is Lib.print()
and Lib.printl()
to write something to the console.
For reading I didn't find a function as easy as that, but it's still easy enough, here's an example:
var stdin = Sys.stdin();
var string : String = stdin.readLine();
If you want to look more into console development in haxe I'd suggest you to look into some projects that uses them, for example to write this question I've read this file https://github.com/ianxm/ihx/blob/master/src/ihx/ConsoleReader.hx