Any command line interpreters for Free Pascal?

classic Classic list List threaded Threaded
37 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Any command line interpreters for Free Pascal?

Andrew Pennebaker
E.g., if fpi existed, I would add a shebang like this to my code:

#!/usr/bin/env fpi

Cheers,

Andrew Pennebaker

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

ik-6

On Sat, Oct 15, 2011 at 00:25, Andrew Pennebaker <[hidden email]> wrote:
E.g., if fpi existed, I would add a shebang like this to my code:

#!/usr/bin/env fpi

Cheers,
 

Andrew Pennebaker

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Andrew Pennebaker
Thanks ik. Merf, it appears fpc can't compile when a shebang is added. In future versions, can fpc treat shebangs as comments so that instantfpc code could be compiled like normal Free Pascal code?

$ cat hello.pas 
#!/usr/bin/env instantfpc
program Hello;
begin
writeln('Hello World!')
end.

$ fpc hello.pas 
Free Pascal Compiler version 2.4.4 [2011/05/01] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Darwin for i386
Compiling hello.pas
hello.pas(1,1) Error: Illegal char constant
hello.pas(1,2) Fatal: Syntax error, "BEGIN" expected but "const string" found
Fatal: Compilation aborted
Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)

Cheers,

Andrew Pennebaker

On Fri, Oct 14, 2011 at 6:29 PM, ik <[hidden email]> wrote:

On Sat, Oct 15, 2011 at 00:25, Andrew Pennebaker <[hidden email]> wrote:
E.g., if fpi existed, I would add a shebang like this to my code:

#!/usr/bin/env fpi

Cheers,
 

Andrew Pennebaker

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

ik-6
On Sat, Oct 15, 2011 at 00:43, Andrew Pennebaker <[hidden email]> wrote:
Thanks ik. Merf, it appears fpc can't compile when a shebang is added. In future versions, can fpc treat shebangs as comments so that instantfpc code could be compiled like normal Free Pascal code?

$ cat hello.pas 
#!/usr/bin/env instantfpc
program Hello;
begin
writeln('Hello World!')
end.


$ chmpd +x hello.pas
$ ./hello.pas


 
$ fpc hello.pas 
Free Pascal Compiler version 2.4.4 [2011/05/01] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Darwin for i386
Compiling hello.pas
hello.pas(1,1) Error: Illegal char constant
hello.pas(1,2) Fatal: Syntax error, "BEGIN" expected but "const string" found
Fatal: Compilation aborted
Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)

Cheers,

Andrew Pennebaker

On Fri, Oct 14, 2011 at 6:29 PM, ik <[hidden email]> wrote:

On Sat, Oct 15, 2011 at 00:25, Andrew Pennebaker <[hidden email]> wrote:
E.g., if fpi existed, I would add a shebang like this to my code:

#!/usr/bin/env fpi

Cheers,
 

Andrew Pennebaker

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

ik-6
On Sat, Oct 15, 2011 at 00:48, ik <[hidden email]> wrote:
On Sat, Oct 15, 2011 at 00:43, Andrew Pennebaker <[hidden email]> wrote:
Thanks ik. Merf, it appears fpc can't compile when a shebang is added. In future versions, can fpc treat shebangs as comments so that instantfpc code could be compiled like normal Free Pascal code?

$ cat hello.pas 
#!/usr/bin/env instantfpc
program Hello;
begin
writeln('Hello World!')
end.


$ chmpd +x hello.pas

Opps,
$ chmod +x hello.pas
 
$ ./hello.pas


 
$ fpc hello.pas 
Free Pascal Compiler version 2.4.4 [2011/05/01] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Darwin for i386
Compiling hello.pas
hello.pas(1,1) Error: Illegal char constant
hello.pas(1,2) Fatal: Syntax error, "BEGIN" expected but "const string" found
Fatal: Compilation aborted
Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)

Cheers,

Andrew Pennebaker

On Fri, Oct 14, 2011 at 6:29 PM, ik <[hidden email]> wrote:

On Sat, Oct 15, 2011 at 00:25, Andrew Pennebaker <[hidden email]> wrote:
E.g., if fpi existed, I would add a shebang like this to my code:

#!/usr/bin/env fpi

Cheers,
 

Andrew Pennebaker

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Andrew Pennebaker
Yeah, I know to chmod my scripts before dot-slashing them. It's just that fpc can't handle shebangs, and I don't want to have to choose either scripting or compiled. I like my Pascal code to be work in either mode.

Cheers,

Andrew Pennebaker

On Fri, Oct 14, 2011 at 6:49 PM, ik <[hidden email]> wrote:
On Sat, Oct 15, 2011 at 00:48, ik <[hidden email]> wrote:
On Sat, Oct 15, 2011 at 00:43, Andrew Pennebaker <[hidden email]> wrote:
Thanks ik. Merf, it appears fpc can't compile when a shebang is added. In future versions, can fpc treat shebangs as comments so that instantfpc code could be compiled like normal Free Pascal code?

$ cat hello.pas 
#!/usr/bin/env instantfpc
program Hello;
begin
writeln('Hello World!')
end.


$ chmpd +x hello.pas

Opps,
$ chmod +x hello.pas
 
$ ./hello.pas


 
$ fpc hello.pas 
Free Pascal Compiler version 2.4.4 [2011/05/01] for i386
Copyright (c) 1993-2010 by Florian Klaempfl
Target OS: Darwin for i386
Compiling hello.pas
hello.pas(1,1) Error: Illegal char constant
hello.pas(1,2) Fatal: Syntax error, "BEGIN" expected but "const string" found
Fatal: Compilation aborted
Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)

Cheers,

Andrew Pennebaker

On Fri, Oct 14, 2011 at 6:29 PM, ik <[hidden email]> wrote:

On Sat, Oct 15, 2011 at 00:25, Andrew Pennebaker <[hidden email]> wrote:
E.g., if fpi existed, I would add a shebang like this to my code:

#!/usr/bin/env fpi

Cheers,
 

Andrew Pennebaker

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Ralf A. Quint
At 03:56 PM 10/14/2011, Andrew Pennebaker wrote:
>Yeah, I know to chmod my scripts before dot-slashing them. It's just
>that fpc can't handle shebangs, and I don't want to have to choose
>either scripting or compiled. I like my Pascal code to be work in either mode.

Gosh, (Free)Pascal is a compiler, not an interpreted script language
as you seem to be accustomed to!

Ralf

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Roland Schäfer
In reply to this post by Andrew Pennebaker
I get the impression that you want to use Pascal for something it wasn't
designed for. Even if you can find some kind of solution, it will
probably be a bad hack. But that question is probably for fpc-other.

So anyway, the only solution I can think of is to automatically comment
out the shebang by calling sed or something from your makefile if you
"compile as a program". (As fas as I understand, this is exactly
equivalent to what instantfpc does in the background, since it is NOT an
interpreter. So what you do is in fact make a lot of fuss about two
different ways of generating and running exactly the same executable.)
You can even remove the comment after compilation again. This is as bad
style as using the old #if 0 construction for debug code in C, though.

Good look,
Roland

On 10/15/2011 12:56 AM, Andrew Pennebaker wrote:

> Yeah, I know to chmod my scripts before dot-slashing them. It's just that
> fpc can't handle shebangs, and I don't want to have to choose either
> scripting or compiled. I like my Pascal code to be work in either mode.
>
> Cheers,
>
> Andrew Pennebaker
> www.yellosoft.us
>
> On Fri, Oct 14, 2011 at 6:49 PM, ik <[hidden email]> wrote:
>
>> On Sat, Oct 15, 2011 at 00:48, ik <[hidden email]> wrote:
>>
>>> On Sat, Oct 15, 2011 at 00:43, Andrew Pennebaker <
>>> [hidden email]> wrote:
>>>
>>>> Thanks ik. Merf, it appears fpc can't compile when a shebang is added. In
>>>> future versions, can fpc treat shebangs as comments so that instantfpc code
>>>> could be compiled like normal Free Pascal code?
>>>>
>>>>  $ cat hello.pas
>>>> #!/usr/bin/env instantfpc
>>>> program Hello;
>>>> begin
>>>> writeln('Hello World!')
>>>> end.
>>>>
>>>>
>>> $ chmpd +x hello.pas
>>>
>>
>> Opps,
>> $ chmod +x hello.pas
>>
>>
>>>  $ ./hello.pas
>>>
>>>
>>>
>>>
>>>> $ fpc hello.pas
>>>> Free Pascal Compiler version 2.4.4 [2011/05/01] for i386
>>>> Copyright (c) 1993-2010 by Florian Klaempfl
>>>> Target OS: Darwin for i386
>>>> Compiling hello.pas
>>>> hello.pas(1,1) Error: Illegal char constant
>>>> hello.pas(1,2) Fatal: Syntax error, "BEGIN" expected but "const string"
>>>> found
>>>> Fatal: Compilation aborted
>>>> Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you
>>>> did not specify a source file to be compiled)
>>>>
>>>> Cheers,
>>>>
>>>> Andrew Pennebaker
>>>> www.yellosoft.us
>>>>
>>>> On Fri, Oct 14, 2011 at 6:29 PM, ik <[hidden email]> wrote:
>>>>
>>>>>
>>>>> On Sat, Oct 15, 2011 at 00:25, Andrew Pennebaker <
>>>>> [hidden email]> wrote:
>>>>>
>>>>>> E.g., if fpi existed, I would add a shebang like this to my code:
>>>>>>
>>>>>> #!/usr/bin/env fpi
>>>>>>
>>>>>>
>>>>> InstantFPC <http://wiki.freepascal.org/InstantFPC>
>>>>>
>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>>
>>>>>> Andrew Pennebaker
>>>>>> www.yellosoft.us
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Roland Schäfer
On 10/15/2011 9:10 AM, Roland Schäfer wrote:
> Good look,

I meant "luck", of course.

> Roland
>
> On 10/15/2011 12:56 AM, Andrew Pennebaker wrote:
>> Yeah, I know to chmod my scripts before dot-slashing them. It's just that
>> fpc can't handle shebangs, and I don't want to have to choose either
>> scripting or compiled. I like my Pascal code to be work in either mode.
>>
>> Cheers,
>>
>> Andrew Pennebaker
>> www.yellosoft.us
>>
>> On Fri, Oct 14, 2011 at 6:49 PM, ik <[hidden email]> wrote:
>>
>>> On Sat, Oct 15, 2011 at 00:48, ik <[hidden email]> wrote:
>>>
>>>> On Sat, Oct 15, 2011 at 00:43, Andrew Pennebaker <
>>>> [hidden email]> wrote:
>>>>
>>>>> Thanks ik. Merf, it appears fpc can't compile when a shebang is added. In
>>>>> future versions, can fpc treat shebangs as comments so that instantfpc code
>>>>> could be compiled like normal Free Pascal code?
>>>>>
>>>>>  $ cat hello.pas
>>>>> #!/usr/bin/env instantfpc
>>>>> program Hello;
>>>>> begin
>>>>> writeln('Hello World!')
>>>>> end.
>>>>>
>>>>>
>>>> $ chmpd +x hello.pas
>>>>
>>>
>>> Opps,
>>> $ chmod +x hello.pas
>>>
>>>
>>>>  $ ./hello.pas
>>>>
>>>>
>>>>
>>>>
>>>>> $ fpc hello.pas
>>>>> Free Pascal Compiler version 2.4.4 [2011/05/01] for i386
>>>>> Copyright (c) 1993-2010 by Florian Klaempfl
>>>>> Target OS: Darwin for i386
>>>>> Compiling hello.pas
>>>>> hello.pas(1,1) Error: Illegal char constant
>>>>> hello.pas(1,2) Fatal: Syntax error, "BEGIN" expected but "const string"
>>>>> found
>>>>> Fatal: Compilation aborted
>>>>> Error: /usr/local/bin/ppc386 returned an error exitcode (normal if you
>>>>> did not specify a source file to be compiled)
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Andrew Pennebaker
>>>>> www.yellosoft.us
>>>>>
>>>>> On Fri, Oct 14, 2011 at 6:29 PM, ik <[hidden email]> wrote:
>>>>>
>>>>>>
>>>>>> On Sat, Oct 15, 2011 at 00:25, Andrew Pennebaker <
>>>>>> [hidden email]> wrote:
>>>>>>
>>>>>>> E.g., if fpi existed, I would add a shebang like this to my code:
>>>>>>>
>>>>>>> #!/usr/bin/env fpi
>>>>>>>
>>>>>>>
>>>>>> InstantFPC <http://wiki.freepascal.org/InstantFPC>
>>>>>>
>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>>
>>>>>>> Andrew Pennebaker
>>>>>>> www.yellosoft.us

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

signature.asc (268 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Tomas Hajny-2
In reply to this post by Andrew Pennebaker
On Sat, October 15, 2011 00:43, Andrew Pennebaker wrote:
> Thanks ik. Merf, it appears fpc can't compile when a shebang is added. In
> future versions, can fpc treat shebangs as comments so that instantfpc
> code
> could be compiled like normal Free Pascal code?
 .
 .

While I agree with others suggesting that you try to use FPC in a way
which it has not been designed for, there is probably a fairly simple
answer for your question (not requiring you to create special scripts or
makefiles, using sed, etc.). I have no experience with instantfpc myself,
but looking at the Wiki page, it seems that it may be used also just for
compilation of the source code if you always invoke instantfpc for
compilation (with the right parameters, especially --skip-run) instead of
using FPC directly. Again, not that I would consider it a very efficient
or reasonable approach, but if you need to do this for whatever reason, it
should apparently address your need.

Tomas


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Marco van de Voort
In reply to this post by Andrew Pennebaker
In our previous episode, Andrew Pennebaker said:
> Thanks ik. Merf, it appears fpc can't compile when a shebang is added. In
> future versions, can fpc treat shebangs as comments so that instantfpc code
> could be compiled like normal Free Pascal code?

I'm not sure that went into 2.4.4 at the same time instantfpc itself did,
possibly it is only in versions after 2.4.4.
 
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Michael Van Canneyt
In reply to this post by Andrew Pennebaker


On Fri, 14 Oct 2011, Andrew Pennebaker wrote:

> Yeah, I know to chmod my scripts before dot-slashing them. It's just that fpc can't handle shebangs, and I don't
> want to have to choose either scripting or compiled. I like my Pascal code to be work in either mode.

It's always compiled.
instantfpc just strips the first line, passes the rest to the compiler
and executes the resulting program. Add some caching for performance,
and that's it.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Marco van de Voort
In our previous episode, Michael Van Canneyt said:
> > Yeah, I know to chmod my scripts before dot-slashing them. It's just that fpc can't handle shebangs, and I don't
> > want to have to choose either scripting or compiled. I like my Pascal code to be work in either mode.
>
> It's always compiled.
> instantfpc just strips the first line, passes the rest to the compiler
> and executes the resulting program. Add some caching for performance,
> and that's it.

I still think instantfpc fails miserably in my primary need for scripting:  installing FPC
:-)

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

MihaiR-2
In reply to this post by ik-6
On Sat, 15 Oct 2011 00:29:28 +0200
ik wrote:

> InstantFPC <http://wiki.freepascal.org/InstantFPC>

Now, you realy made my day :))
I am using FPC and Lazarus for very nice things almost every day and
I love it.
I missed something like InstantFPC. Congratulations!!! Please keep up
the good work guys.

Best regards,
Mihai
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Florian Klämpfl
In reply to this post by Marco van de Voort
Am 15.10.2011 12:10, schrieb Marco van de Voort:

> In our previous episode, Michael Van Canneyt said:
>>> Yeah, I know to chmod my scripts before dot-slashing them. It's just that fpc can't handle shebangs, and I don't
>>> want to have to choose either scripting or compiled. I like my Pascal code to be work in either mode.
>>
>> It's always compiled.
>> instantfpc just strips the first line, passes the rest to the compiler
>> and executes the resulting program. Add some caching for performance,
>> and that's it.
>
> I still think instantfpc fails miserably in my primary need for scripting:  installing FPC
> :-)

So you need some packer for instantfpc scripts which puts together fpc
and basic rtl which are uncompressed for the actual installation :)

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Andrew Pennebaker
In reply to this post by Marco van de Voort
Good idea, van de Voort. Can someone confirm that fpc plays nicely with shebangs in a version after 2.4.4?

And Schäfer, I respect Pascal for being a compiled language. I myself and fond of Haskell. But Haskell has a scripted mode, and instantfpc, like all good interpreters, compiles code in the background. It's simply a convenience to write scripts, whether the language you're using is mostly interpreted or mostly compiled.

Cheers,

Andrew Pennebaker

On Sat, Oct 15, 2011 at 5:47 AM, Marco van de Voort <[hidden email]> wrote:
In our previous episode, Andrew Pennebaker said:
> Thanks ik. Merf, it appears fpc can't compile when a shebang is added. In
> future versions, can fpc treat shebangs as comments so that instantfpc code
> could be compiled like normal Free Pascal code?

I'm not sure that went into 2.4.4 at the same time instantfpc itself did,
possibly it is only in versions after 2.4.4.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Jonas Maebe-2

On 15 Oct 2011, at 17:24, Andrew Pennebaker wrote:

> Good idea, van de Voort. Can someone confirm that fpc plays nicely with
> shebangs in a version after 2.4.4?

It doesn't.


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Marco van de Voort
In reply to this post by Andrew Pennebaker
In our previous episode, Andrew Pennebaker said:
> Good idea, van de Voort. Can someone confirm that fpc plays nicely with
> shebangs in a version after 2.4.4?

I just tried, and it doesn't. I assume that it was talked about and got stuck in
my mind, but it never really was implemented.
 
> And Sch?fer, I respect Pascal for being a compiled language. I myself and
> fond of Haskell. But Haskell has a scripted mode, and instantfpc, like all
> good interpreters, compiles code in the background. It's simply a
> convenience to write scripts, whether the language you're using is mostly
> interpreted or mostly compiled.

It works surprisingly good with FPC, probably because small programs in FPC
don't need special parameters to compile.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Jürgen Hestermann
In reply to this post by Andrew Pennebaker


Andrew Pennebaker schrieb:
 > It's simply a convenience to write scripts, whether the language
you're using is mostly interpreted or mostly compiled.

Whether scripting language or compiled language, you have to write the
same code in both cases. Where is the difference?

The only advantage for scripts is that the source code is directly
visible and cannot be hidden. But that can also be a disadvantage.

Nevertheless, I don't see any use in InstantFPC. The program starts much
faster if it has already been compiled and there is no need to compile
the source in the background before startup.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Any command line interpreters for Free Pascal?

Andrew Pennebaker
Hestermann:

Indeed, compiled programs will always run faster than interpreted programs. The value in scripting is that an interpreted environment allows coders to rapidly go through write code / test code loops. Interpreters let you explore your own codebase, like gdb but far more powerful.

Adding shebangs to fpc wouldn't kill Pascal or compiled programming. It would welcome scripting programmers into the Pascal community, and let Pascal programmers write and test code more quickly. The same programs that use instantfpc work in fpc; it turns out instantfpc runs fpc in the background. The main difference is that fpc currently borks on shebangs--but it doesn't have to.

Again, there's no need to fret about interpreted vs compiled. Even for compiled languages, there are interpreted options.

Haskell -> GHCi
Java -> Beanshell
Erlang -> erl

Finally, adding scripting capability to a programming language allows coders to use a language to be used for shell scripts. If you love Pascal, you might want to write sysadmin tools in Pascal to automate your workflow.

Cheers,

Andrew Pennebaker

On Sat, Oct 15, 2011 at 12:13 PM, Jürgen Hestermann <[hidden email]> wrote:


Andrew Pennebaker schrieb:

> It's simply a convenience to write scripts, whether the language you're using is mostly interpreted or mostly compiled.

Whether scripting language or compiled language, you have to write the same code in both cases. Where is the difference?

The only advantage for scripts is that the source code is directly visible and cannot be hidden. But that can also be a disadvantage.

Nevertheless, I don't see any use in InstantFPC. The program starts much faster if it has already been compiled and there is no need to compile the source in the background before startup.


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
12