Re: [fpc-pascal] FPC run (run program after compile)
On Sat, January 21, 2017 11:54 pm, I previously wrote: > https://github.com/z505/fpcRun > > > Project started on github. Tested to work on Windows. > > > Now I just have to try Unix, as, executeprocess works slightly different > on that system and some absolute path configuration to fpc might be needed. > Solution was to use fpSystem instead of ExecuteProcess on unix, and use ExecuteProcess on Windows fpr or FPCRUN project seems to work good so far on linux and windows now. Bsd/macos I have not tested ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC run (run program after compile)
On Mon, January 16, 2017 1:21 pm, Lars wrote: .. > On Mon, January 16, 2017 3:59 am, Sven Barth wrote: >> No, FPC is a compiler, not a "runner" or debugger. That would even be >> one of the few points where patches would *not* be welcome. >> > > fpcrun.exe is an alternative to "fpc run" > > fpcrun.exe is trivial, and I can copy it into my fpc directory.. but > wondered if others needed it. trivial indeed... https://github.com/z505/fpcRun Project started on github. Tested to work on Windows. Now I just have to try Unix, as, executeprocess works slightly different on that system and some absolute path configuration to fpc might be needed. So basically FPCRUN.EXE project is now known as fpr.exe... as fpr is easier to type at the command line for the lazy ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC run (run program after compile)
On Mon, 16 Jan 2017 13:15:40 -0700 "Lars"wrote: >[...] > Does instantfpc make it mandatory that you put this at the top of every > source file: > > #!/usr/local/bin/fpc.d/3.0.0/instantfpc --set-cache=./ No. That's only needed if you want to run the Pascal file directly: ./project1.pas > fpcrun would not require this as it just compiles normally... > > However making fpcrun.exe (trivial) would duplicate what instantfpc > already kind of sort of does, so I do not want fpc to ship two executables > that do the same thing (or similar)... fpc has a much slower startup time than instantfpc. That's why instantfpc is good for running Pascal scripts. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC run (run program after compile)
On Mon, January 16, 2017 3:59 am, Sven Barth wrote: > Am 16.01.2017 08:07 schrieb "Lars": > >> >> Is there a way to compile a program with fpc at the command line and >> run it right after? >> >> Something like >> fpc run project1.pas -Fu../ > > No, FPC is a compiler, not a "runner" or debugger. That would even be one > of the few points where patches would *not* be welcome. > fpcrun.exe is an alternative to "fpc run" fpcrun.exe is trivial, and I can copy it into my fpc directory.. but wondered if others needed it. But I don't want to duplicate what instantfpc does... so might be better to modify instantfpc. Still, fpcrun.exe would be trivial to make so that is still tempting... as instantfpc may require adding a parameter like Mattias was saying, whereas fpcrun.exe would require no parameters. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC run (run program after compile)
On Mon, January 16, 2017 6:59 am, Mark Morgan Lloyd wrote: > On 16/01/17 13:30, Mattias Gaertner wrote: > >> On Mon, 16 Jan 2017 05:22:14 -0700 >> "Lars"wrote: >> >> >>> [...] >>> That instantfpc has catch22 like you cant compule multiple projects >>> with the same name, i.e. it caches file name only (caveat) whereas >>> fpcrun would compile it in current directory, as normal, no special >>> cache dir needed >> >> Feel free to add an option like "--inplace" and send the patch. >> > > This works > > > #!/usr/local/bin/fpc.d/3.0.0/instantfpc --set-cache=./ > > > program Test; .. > > Does instantfpc make it mandatory that you put this at the top of every source file: > #!/usr/local/bin/fpc.d/3.0.0/instantfpc --set-cache=./ fpcrun would not require this as it just compiles normally... However making fpcrun.exe (trivial) would duplicate what instantfpc already kind of sort of does, so I do not want fpc to ship two executables that do the same thing (or similar)... > except that the original file's getting modified to put // in front of the > shebang which means that a second instantfpc run fails. > Interesting idea, to just cache it in the original project directory. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC run (run program after compile)
On 16/01/17 13:30, Mattias Gaertner wrote: On Mon, 16 Jan 2017 05:22:14 -0700 "Lars"wrote: [...] That instantfpc has catch22 like you cant compule multiple projects with the same name, i.e. it caches file name only (caveat) whereas fpcrun would compile it in current directory, as normal, no special cache dir needed Feel free to add an option like "--inplace" and send the patch. This works #!/usr/local/bin/fpc.d/3.0.0/instantfpc --set-cache=./ program Test; .. except that the original file's getting modified to put // in front of the shebang which means that a second instantfpc run fails. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues] ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC run (run program after compile)
On Mon, 16 Jan 2017 05:22:14 -0700 "Lars"wrote: >[...] > That instantfpc has catch22 like you cant compule multiple projects with > the same name, i.e. it caches file name only (caveat) whereas fpcrun would > compile it in current directory, as normal, no special cache dir needed Feel free to add an option like "--inplace" and send the patch. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC run (run program after compile)
On Mon, January 16, 2017 3:08 am, Mattias Gaertner wrote: > On Mon, 16 Jan 2017 00:06:59 -0700 > "Lars"wrote: > > >> Is there a way to compile a program with fpc at the command line and >> run it right after? >> >> Something like >> fpc run project1.pas -Fu../ > > instantfpc -Fu../ project1.pas > > Looks good... >> The only thing I could find was InstantFpc, which may serve similar >> purpose but not really the same as what I was thinking... > > And what are you thinking? > > That instantfpc has catch22 like you cant compule multiple projects with the same name, i.e. it caches file name only (caveat) whereas fpcrun would compile it in current directory, as normal, no special cache dir needed Also I am thinking about 3 million two thousand and eight other ideas at the moment Possibly a.d.h.d meds > Mattias > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC run (run program after compile)
Am 16.01.2017 08:07 schrieb "Lars": > > Is there a way to compile a program with fpc at the command line and run > it right after? > > Something like > fpc run project1.pas -Fu../ No, FPC is a compiler, not a "runner" or debugger. That would even be one of the few points where patches would *not* be welcome. As the others said already, use InstantFPC for that. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC run (run program after compile)
On Mon, 16 Jan 2017 00:06:59 -0700 "Lars"wrote: > Is there a way to compile a program with fpc at the command line and run > it right after? > > Something like > fpc run project1.pas -Fu../ instantfpc -Fu../ project1.pas > The only thing I could find was InstantFpc, which may serve similar > purpose but not really the same as what I was thinking... And what are you thinking? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC run (run program after compile)
On Mon, January 16, 2017 2:55 am, Graeme Geldenhuys wrote: > On 2017-01-16 07:06, Lars wrote: > >> The only thing I could find was InstantFpc, which may serve similar >> purpose but not really the same as what I was thinking... > > If InstantFPC doesn't work for you, you could always compile the FPC > Compiler into your "own" executable that does compilation and then > running the resulting executable. Indeed, would not be too hard... even a shell script like you say.. If anyone finds this idea useful of seeing your program run, right after a compile, at the command line, it might be something to add to fpc. It is similar to how when you press F9 in delphi or compile a program in turbopascal/fpide it runs the program for you, without multiple link/compile/run steps like GCC and old C compilers required. As for instantFPC, that would maybe make pascal programs run on a webserver just by uploading them.. which is very interesting more research to be done there as to what has to be installed on the server for that to work... some kind of fpc compiler will need to be on the server and in what directories. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] FPC run (run program after compile)
On 2017-01-16 07:06, Lars wrote: > The only thing I could find was InstantFpc, which may serve similar > purpose but not really the same as what I was thinking... If InstantFPC doesn't work for you, you could always compile the FPC Compiler into your "own" executable that does compilation and then running the resulting executable. Alternatively, you could turn to a simple Bash script (if you are on a Unix/Linux platform) to accomplish the same task. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal