A C++ interpreter

Dejan Lekic dejan.lekic at gmail.com
Fri Aug 17 05:38:22 PDT 2012


On Sunday, 12 August 2012 at 23:56:02 UTC, bearophile wrote:
> This not at the top of my enhancement request list, but having 
> something like this shared by all D compilers seems a step 
> forward for D:
>
> http://blog.coldflake.com/posts/2012-08-09-On-the-fly-C%2B%2B.html
>
> I use the Python shell all the time, for things like:
> - As a calculator able to do basic things;
> - to import files and process them on the fly in some ways 
> (some of the things that are also doable with Unix shell 
> commands);
> - importing libraries to do lot of things, like graphing with 
> matPlotLib;
> - To try and fix lines/snippets of code to integrate in Python 
> programs;
> - To try things that later I will put inside unit tests 
> (especially doctests);
> - To import whole modules from the shell and try them, to see 
> if they work, to understand how they need to be used, to try 
> ideas to debug them, and so on.
>
> There is a shell in Scala too:
> http://www.scala-lang.org/node/166
>
> Bye,
> bearophile

Doing shell scripting in ANY language not designed for shell 
scripting is the same as shooting yourself in the foot with AK-47 
... Whoever does that is just blindly loyal to the language.

Following BASH one-liner will (hopefully) explain my point. -Try 
to implement the following in D, Scala, and any other language 
not made for shell scripting:

history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | 
sort | uniq -c | sort -n | tail | sort -nr

It will output 10 most used commands in your shell.


More information about the Digitalmars-d mailing list