TelluIoT / ThingML

The ThingML modelling language
https://github.com/TelluIoT/ThingML
Apache License 2.0
101 stars 32 forks source link

Make NodeJS's prints compatible with Browsersify #251

Closed fungiboletus closed 5 years ago

fungiboletus commented 5 years ago

I read the console.log NodeJS source code, and I see no good reasons to prefer process.stdout.write over a beautiful console.log.

The console.log is more standard and the change reduces the number of lines of code.

brice-morin commented 5 years ago

Well, in ThingML, we have print and println. While console.log is indeed a good candidate for println, we had some issues using it for the print, since it seems console.log always terminates with a new line... Can you really do a print?

However, if relying on console.log makes things easier in your project of re-unifying the different JS compilers, it is probably worth not caring too much about the print (which anyway, is only supported in NodeJS and not in the browser)

@ffleurey ??

fungiboletus commented 5 years ago

Oh I see. I could make a version which use console.log as fallback.

brice-morin commented 5 years ago

That would be perfect :-)

fungiboletus commented 5 years ago

The new implementation has a few more "if" which may have a performance impact for big data CSV transformations using ThingML.

brice-morin commented 5 years ago

Well, my colleagues have other tools for CSV-driven big data.... So I assume we should be fine :-)