nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.55k stars 1.47k forks source link

Nim script is not supporting reading from stdin. #3983

Closed enthus1ast closed 5 years ago

enthus1ast commented 8 years ago

As reported here http://stackoverflow.com/questions/36103424/how-to-read-from-the-stdin-with-nim-script/36103582 nim script is throwing

Error: undeclared identifier: 'stdin'

when reading from stdin.

Araq commented 8 years ago

Why would anybody want this? "Let's transform the compiler into an interactive program." Why?

enthus1ast commented 8 years ago

it would be nice to ask the user are you shure [y/n]: or param1 [foo]:

this would be very usefull in an interactiv build/bundle process. And it would be "always there"

Araq commented 8 years ago

Let's give Nimble this feature, not Nim.

genotrance commented 5 years ago

Nimscript claims to be a standalone scripting language. Reading from stdin seems like a really basic feature. It may be the same VM used by the compiler at compile time but seems fair to allow more capabilities when using it in nimscript mode.

Araq commented 5 years ago
  1. Reading from stdin makes the process unusable in a CI setting.
  2. The NimScript API offers the ability to add native Nim calls that can perform anything you need to do.
genotrance commented 5 years ago

This has been implemented in PR #10292.