digitalmars.D - A C++ interpreter
- bearophile (21/21) Aug 12 2012 This not at the top of my enhancement request list, but having
- Marco Leise (6/31) Aug 12 2012 Man, and I've been using JavaScript and a browser to prototype...
- Andrej Mitrovic (2/3) Aug 12 2012 http://dlang.org/rdmd.html
- Marco Leise (5/9) Aug 12 2012 Aw come on, that is not a shell
- Era Scarecrow (4/11) Aug 12 2012 Isn't rdmd just a wrapper for the compiler, then calls the
- Russel Winder (17/31) Aug 12 2012 Shells such as Python, Scala, etc. are good for some one-off experiments
- bearophile (5/9) Aug 13 2012 To me they seem underrated, go figure :-) In Python I use it all
- Matt Soucy (9/17) Aug 13 2012 Agreed, I use Python's shell often at work - usually when I just need to...
- Jacob Carlborg (7/13) Aug 13 2012 I'm using TextMate (Mac OS X) and rdmd. I just create a new document,
- Jacob Carlborg (6/10) Aug 13 2012 BTW, I'm using the same method with Ruby as well. I prefer this over the...
- Andrej Mitrovic (2/10) Aug 13 2012 + it's easier to re-edit or copy code in a text editor than in a shell.
- jerro (5/7) Aug 13 2012 Rdmd already has this functionality with the --eval flag. You are
- Nick Sabalausky (6/16) Aug 13 2012 As a person who's still only half-way a Linux guy, I have to ask: What
- jerro (15/24) Aug 13 2012 The minus on the cat command line means standard input and
- Graham Fawcett (11/30) Aug 17 2012 Run the "cat" program, which prints two file contents: the first
- Graham Fawcett (7/41) Aug 17 2012 I meant to add, the point of this appears to be that you can
- Jacob Carlborg (4/9) Aug 14 2012 Yeah, but I need to hook it up from within TextMate, which isn't a probl...
- Mehrdad (2/6) Aug 14 2012 Wow, no wonder I never found it handy in Windows...
- Brad Anderson (6/34) Aug 13 2012 I just use http://dpaste.dzfl.pl for my quick testing.
- 1100110 (10/31) Aug 19 2012 Here come the flames, but check out vim + the D Syntastic plugin.
- Andrej Mitrovic (8/15) Aug 13 2012 That C++ blog post begins with talking how hard it is to just compile
- Dmitry Olshansky (4/7) Aug 13 2012 Also check the --eval and --loop thingy ;)
- Era Scarecrow (3/7) Aug 13 2012 There's also CInt, but I've never tried it myself.
- Nick Sabalausky (3/13) Aug 13 2012 Heh, "CInt" sounds more like a boxed integer :)
- Dejan Lekic (10/32) Aug 17 2012 Doing shell scripting in ANY language not designed for shell
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
Aug 12 2012
Am Mon, 13 Aug 2012 01:56:01 +0200 schrieb "bearophile" <bearophileHUGS lycos.com>: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, bearophileMan, and I've been using JavaScript and a browser to prototype... While that's true, I also have a project called 'test' always open in MonoDevelop, so this is my ready to use main function. Sometimes I copy that code over into proper module, if it looks generally useful. -- Marco
Aug 12 2012
On 8/13/12, bearophile <bearophileHUGS lycos.com> wrote:http://blog.coldflake.com/posts/2012-08-09-On-the-fly-C%2B%2B.htmlhttp://dlang.org/rdmd.html
Aug 12 2012
Am Mon, 13 Aug 2012 05:38:01 +0200 schrieb Andrej Mitrovic <andrej.mitrovich gmail.com>:On 8/13/12, bearophile <bearophileHUGS lycos.com> wrote:Aw come on, that is not a shell -- Marcohttp://blog.coldflake.com/posts/2012-08-09-On-the-fly-C%2B%2B.htmlhttp://dlang.org/rdmd.html
Aug 12 2012
On Monday, 13 August 2012 at 04:25:19 UTC, Marco Leise wrote:Am Mon, 13 Aug 2012 05:38:01 +0200 schrieb Andrej Mitrovic <andrej.mitrovich gmail.com>:Isn't rdmd just a wrapper for the compiler, then calls the compiled code (or previously saved version of it) afterwards? (That's the impression I get anyways)On 8/13/12, bearophile <bearophileHUGS lycos.com> wrote:Aw come on, that is not a shellhttp://blog.coldflake.com/posts/2012-08-09-On-the-fly-C%2B%2B.htmlhttp://dlang.org/rdmd.html
Aug 12 2012
On Mon, 2012-08-13 at 07:53 +0200, Era Scarecrow wrote:On Monday, 13 August 2012 at 04:25:19 UTC, Marco Leise wrote:Shells such as Python, Scala, etc. are good for some one-off experiments and tasks, but I think in general they are over-rated in general usefulness. Much better for non-trivial experimentation is to have a super-lightweight editor/execution. Groovy has GroovyConsole, Python has IDLE. Personally I find Emacs/rdmd excellent as an experimentation combination for D codes. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winderAm Mon, 13 Aug 2012 05:38:01 +0200 schrieb Andrej Mitrovic <andrej.mitrovich gmail.com>:=20 Isn't rdmd just a wrapper for the compiler, then calls the=20 compiled code (or previously saved version of it) afterwards?=20 (That's the impression I get anyways)On 8/13/12, bearophile <bearophileHUGS lycos.com> wrote:Aw come on, that is not a shellhttp://blog.coldflake.com/posts/2012-08-09-On-the-fly-C%2B%2B.html=20 http://dlang.org/rdmd.html
Aug 12 2012
Russel Winder:Shells such as Python, Scala, etc. are good for some one-off experiments and tasks, but I think in general they are over-rated in general usefulness.To me they seem underrated, go figure :-) In Python I use it all the time. Maybe in D it will be a little less useful. Bye, bearophile
Aug 13 2012
On 08/13/2012 04:42 AM, bearophile wrote:Russel Winder:Agreed, I use Python's shell often at work - usually when I just need to test something, but sometimes when someone else asks me for a particular script that does something that (I feel) is only really good for their one situation. I use the scripts I have already and just manually write up a comprehension or five to convert the data into a format that will be useful for them. It doesn't seem worth the effort to make a whole new script just for that. -Matt SoucyShells such as Python, Scala, etc. are good for some one-off experiments and tasks, but I think in general they are over-rated in general usefulness.To me they seem underrated, go figure :-) In Python I use it all the time. Maybe in D it will be a little less useful. Bye, bearophile
Aug 13 2012
On 2012-08-13 08:51, Russel Winder wrote:Shells such as Python, Scala, etc. are good for some one-off experiments and tasks, but I think in general they are over-rated in general usefulness. Much better for non-trivial experimentation is to have a super-lightweight editor/execution. Groovy has GroovyConsole, Python has IDLE. Personally I find Emacs/rdmd excellent as an experimentation combination for D codes.I'm using TextMate (Mac OS X) and rdmd. I just create a new document, type the code and run it from within TextMate. I don't even have to save the document. I probably should make it so it automatically wraps the code in a main function for even easier and more script like usage. -- /Jacob Carlborg
Aug 13 2012
On 2012-08-13 16:03, Jacob Carlborg wrote:I'm using TextMate (Mac OS X) and rdmd. I just create a new document, type the code and run it from within TextMate. I don't even have to save the document. I probably should make it so it automatically wraps the code in a main function for even easier and more script like usage.BTW, I'm using the same method with Ruby as well. I prefer this over the IRB, the Ruby shell. I mean, I have syntax highlighting and other nice features I'm missing in the shell. -- /Jacob Carlborg
Aug 13 2012
On 8/13/12, Jacob Carlborg <doob me.com> wrote:On 2012-08-13 16:03, Jacob Carlborg wrote:+ it's easier to re-edit or copy code in a text editor than in a shell.I'm using TextMate (Mac OS X) and rdmd. I just create a new document, type the code and run it from within TextMate. I don't even have to save the document. I probably should make it so it automatically wraps the code in a main function for even easier and more script like usage.BTW, I'm using the same method with Ruby as well. I prefer this over the IRB, the Ruby shell. I mean, I have syntax highlighting and other nice features I'm missing in the shell.
Aug 13 2012
I probably should make it so it automatically wraps the code in a main function for even easier and more script like usage.Rdmd already has this functionality with the --eval flag. You are supposed to pass the code as a command line parameter, but you can use it with files like this: cat - test.d <<< "--eval=" | xargs -0 rdmd I've only tried this on Linux.
Aug 13 2012
On Mon, 13 Aug 2012 17:36:13 +0200 "jerro" <a a.com> wrote:As a person who's still only half-way a Linux guy, I have to ask: What the hell is going on in that command? I understand bits and pieces of it, but my mind's having a hard time parsing it. Can any of you unix gurus help me out?I probably should make it so it automatically wraps the code in a main function for even easier and more script like usage.Rdmd already has this functionality with the --eval flag. You are supposed to pass the code as a command line parameter, but you can use it with files like this: cat - test.d <<< "--eval=" | xargs -0 rdmd I've only tried this on Linux.
Aug 13 2012
The minus on the cat command line means standard input and somecommand <<< "somestring" Sends "somestring" to the standard input of somecommand. So the first part here outputs the contents of test.d with --eval= prepended. That's what xargs get as a standard input. Xargs then calls rdmd with that string as a command line argument. The -0 flag tells xargs to treat the input as a bunch of zero separated strings and to treat backslashes and double quotes the same as other characters (the default is to treat newlines and spaces as separators and to use quotes and backslashes to prevent spliting strings on newlines and spaces). I did it that way to avoid issues with escaping characters.cat - test.d <<< "--eval=" | xargs -0 rdmd I've only tried this on Linux.As a person who's still only half-way a Linux guy, I have to ask: What the hell is going on in that command?I understand bits and pieces of it, but my mind's having a hard time parsing it. Can any of you unix gurus help me out?I'm hardly a unix guru, I've been using linux for less than two years. I guess it's not hard to write hard to read bash commands :D
Aug 13 2012
On Tuesday, 14 August 2012 at 04:09:22 UTC, Nick Sabalausky wrote:On Mon, 13 Aug 2012 17:36:13 +0200 "jerro" <a a.com> wrote:Run the "cat" program, which prints two file contents: the first file is stdin (denoted by "-"), which contains the text "--eval=", via the <<< redirector. Cat then prints the contents of test.d. All of this is piped in to "xargs", which calls dmd along with the command line arguments consisting of the piped input. It's overly complicated. Try this instead: rdmd --eval="$(cat test.d)" Best, GrahamAs a person who's still only half-way a Linux guy, I have to ask: What the hell is going on in that command? I understand bits and pieces of it, but my mind's having a hard time parsing it. Can any of you unix gurus help me out?I probably should make it so it automatically wraps the code in a main function for even easier and more script like usage.Rdmd already has this functionality with the --eval flag. You are supposed to pass the code as a command line parameter, but you can use it with files like this: cat - test.d <<< "--eval=" | xargs -0 rdmd I've only tried this on Linux.
Aug 17 2012
On Friday, 17 August 2012 at 12:53:50 UTC, Graham Fawcett wrote:On Tuesday, 14 August 2012 at 04:09:22 UTC, Nick Sabalausky wrote:I meant to add, the point of this appears to be that you can execute a "toplevel expression." So test.d should contain bare statements, e.g. import std.stdio; writeln("hi"); rather than void main() { import std.stdio; writeln("hi"); }On Mon, 13 Aug 2012 17:36:13 +0200 "jerro" <a a.com> wrote:Run the "cat" program, which prints two file contents: the first file is stdin (denoted by "-"), which contains the text "--eval=", via the <<< redirector. Cat then prints the contents of test.d. All of this is piped in to "xargs", which calls dmd along with the command line arguments consisting of the piped input. It's overly complicated. Try this instead: rdmd --eval="$(cat test.d)" Best, GrahamAs a person who's still only half-way a Linux guy, I have to ask: What the hell is going on in that command? I understand bits and pieces of it, but my mind's having a hard time parsing it. Can any of you unix gurus help me out?I probably should make it so it automatically wraps the code in a main function for even easier and more script like usage.Rdmd already has this functionality with the --eval flag. You are supposed to pass the code as a command line parameter, but you can use it with files like this: cat - test.d <<< "--eval=" | xargs -0 rdmd I've only tried this on Linux.
Aug 17 2012
On 2012-08-13 17:36, jerro wrote:Rdmd already has this functionality with the --eval flag. You are supposed to pass the code as a command line parameter, but you can use it with files like this: cat - test.d <<< "--eval=" | xargs -0 rdmd I've only tried this on Linux.Yeah, but I need to hook it up from within TextMate, which isn't a problem. -- /Jacob Carlborg
Aug 14 2012
On Monday, 13 August 2012 at 15:36:15 UTC, jerro wrote:Rdmd already has this functionality with the --eval flag. You are supposed to pass the code as a command line parameter, but you can use it with files like this: cat - test.d <<< "--eval=" | xargs -0 rdmdWow, no wonder I never found it handy in Windows...
Aug 14 2012
On Mon, Aug 13, 2012 at 12:51 AM, Russel Winder <russel winder.org.uk>wrote:On Mon, 2012-08-13 at 07:53 +0200, Era Scarecrow wrote:I just use http://dpaste.dzfl.pl for my quick testing. I do miss not having vim keybindings but I do gain dmd-git support without the pain of setting it up locally. I'm often testing stuff during a discussion in #D IRC so the site makes it much easier to share as well. BAOn Monday, 13 August 2012 at 04:25:19 UTC, Marco Leise wrote:Shells such as Python, Scala, etc. are good for some one-off experiments and tasks, but I think in general they are over-rated in general usefulness. Much better for non-trivial experimentation is to have a super-lightweight editor/execution. Groovy has GroovyConsole, Python has IDLE. Personally I find Emacs/rdmd excellent as an experimentation combination for D codes. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winderAm Mon, 13 Aug 2012 05:38:01 +0200 schrieb Andrej Mitrovic <andrej.mitrovich gmail.com>:Isn't rdmd just a wrapper for the compiler, then calls the compiled code (or previously saved version of it) afterwards? (That's the impression I get anyways)On 8/13/12, bearophile <bearophileHUGS lycos.com> wrote:Aw come on, that is not a shellhttp://blog.coldflake.com/posts/2012-08-09-On-the-fly-C%2B%2B.htmlhttp://dlang.org/rdmd.html
Aug 13 2012
On Mon, 13 Aug 2012 01:51:17 -0500, Russel Winder <russel winder.org.uk> wrote:On Mon, 2012-08-13 at 07:53 +0200, Era Scarecrow wrote:Here come the flames, but check out vim + the D Syntastic plugin. (not you in particular. =P) I have it set to check every time I save the file. This, coupled with a barebones.d file, allows easy experimentation. It highlights the error the line is on, and shows the error msg when you are on that line. -- Using Opera's revolutionary email client: http://www.opera.com/mail/On Monday, 13 August 2012 at 04:25:19 UTC, Marco Leise wrote:Shells such as Python, Scala, etc. are good for some one-off experiments and tasks, but I think in general they are over-rated in general usefulness. Much better for non-trivial experimentation is to have a super-lightweight editor/execution. Groovy has GroovyConsole, Python has IDLE. Personally I find Emacs/rdmd excellent as an experimentation combination for D codes.Am Mon, 13 Aug 2012 05:38:01 +0200 schrieb Andrej Mitrovic <andrej.mitrovich gmail.com>:Isn't rdmd just a wrapper for the compiler, then calls the compiled code (or previously saved version of it) afterwards? (That's the impression I get anyways)On 8/13/12, bearophile <bearophileHUGS lycos.com> wrote:Aw come on, that is not a shellhttp://blog.coldflake.com/posts/2012-08-09-On-the-fly-C%2B%2B.htmlhttp://dlang.org/rdmd.html
Aug 19 2012
On 8/13/12, Marco Leise <Marco.Leise gmx.de> wrote:Am Mon, 13 Aug 2012 05:38:01 +0200 schrieb Andrej Mitrovic <andrej.mitrovich gmail.com>:That C++ blog post begins with talking how hard it is to just compile something to test things out. All I ever have to do is hit CTRL+ALT+J and I get a new D file opened in my editor with some common Phobos imports. Then I hit F4 and RDMD compiles and runs the app. I've been using this for years, I've got well over 1000 files in my test directory. I don't see what a shell can provide when building D scripts is so damn fast anyway. :)On 8/13/12, bearophile <bearophileHUGS lycos.com> wrote:Aw come on, that is not a shellhttp://blog.coldflake.com/posts/2012-08-09-On-the-fly-C%2B%2B.htmlhttp://dlang.org/rdmd.html
Aug 13 2012
On 13-Aug-12 07:38, Andrej Mitrovic wrote:On 8/13/12, bearophile <bearophileHUGS lycos.com> wrote:Also check the --eval and --loop thingy ;) -- Dmitry Olshanskyhttp://blog.coldflake.com/posts/2012-08-09-On-the-fly-C%2B%2B.htmlhttp://dlang.org/rdmd.html
Aug 13 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.htmlThere's also CInt, but I've never tried it myself. http://root.cern.ch/drupal/content/cint
Aug 13 2012
On Mon, 13 Aug 2012 14:13:19 +0200 "Era Scarecrow" <rtcvb32 yahoo.com> wrote:On Sunday, 12 August 2012 at 23:56:02 UTC, bearophile wrote:Heh, "CInt" sounds more like a boxed integer :)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.htmlThere's also CInt, but I've never tried it myself. http://root.cern.ch/drupal/content/cint
Aug 13 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, bearophileDoing 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.
Aug 17 2012