Is Free Pascal a Programming language by itself? Or, just a compiler supporting Pascal development? [closed] - pascal

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I'm terribly confused when I searched about Free Pascal. freepascal.org says it is a compiler that is used to compile Pascal language code over systems of various architectures. But, I've also found few jobs posted online seeking a Free Pascal programmer. Please throw some light on this. Thanks in advance!

Free Pascal is a compiler that supports several dialects.
A lot of confusion like yours comes from oversimplified articles that present FPC/Lazarus as dropin Delphi substitute. Lazarus/fpc's entire development history is different however from both TP and Delphi.
Most of dialect modes are existing dialects with minor extensions (usually features supported by all dialects), and some dialects (like Objective Pascal) are wholly a Free Pascal invention.
Some of the dialects:
{$mode tp} - turbo pascal dialect
{$mode fpc} - Default mode. Turbo Pascal dialect cleaned of dosisms and 16-bitism (few differences to TP)
{$mode Delphi} - Delphi dialect + compatible extensions
{$mode DelphiUnicode} - Delphi dialect that changes string to unicodestring like D2009 (incomplete runtime support though)
{$Mode objfpc} - Free Pascal version of the Delphi dialect. (incompatible extensions)
{$mode macpascal} - Apple based pascal's, mostly Codewarrior derived
{$mode ISO} - Work in process ISO-7185 Pascal mode.
{$modeswitch objectivec1} and {$modeswitch objectivec2}, switches on objective C object model for easier COCOA interfacing, the differences are the same as objective C 1.x and 2.x languages/runtimes. This is Objective Pascal
The main missing one is ISO10206 (1990), the second Pascal language standard (that most major vendors ignored)
The dialect mode is a per unit decision, multiple dialects can be used in one program. Mode objfpc is the default mode of Lazarus, and thus the most used dialect nowadays.
A typical example of an incompatible extension in mode objfpc is requiring # for procedure (or method-) variable assignment. This is a disambiguation for certain cases where the proctype is the return value of a function.
Some of the $mode objfpc differences have been implemented in later Delphi versions (like {$pointermath on}, the later which is default in $mode objfpc). $Mode objfpc also had a really early (early 2007) implementation of generics model after C++

Free Pascal is a compiler, as the site says. However, it is not unusual for various compiler manufacturers - even including FOSS compiler authors - to incorporate extensions to the standard definition of the language the compiler compiles. When you see a job ad for a "x programmer" where x is a specific implementation (e.g., Free Pascal), it generally means that "this is the compiler we use; you should be familiar with it and with the extensions to the language that it supports".
In some cases - for example, early Turbo Pascal - it might also refer to the use of the specific product as a complete development environment (IDE), if it includes one, and you would be expected to be familiar with the various components of the IDE as well.

Related

Is GCC being replaced by LLVM? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I wonder whether LLVM by virtue of its newer design is to replace GCC in the open-source world?
LLVM should feature several techniques of inspecting code, so that IDE's are easier to program etc. However, GCC should still be good in terms of performance.
Short answer: No. They're both widely used depending on the context.
Long answer:
Depends, it's a matter of adoption as well as other factors.
For example, Apple uses LLVM (and Clang) for pretty much everything including building the kernel (previously built using GCC), bootloader and the userspace. As well as that, LLVM is used in the graphics drivers for compiling shaders to SGX USSE bytestreams, though here it's largely a case of eating your own dogfood.
As well as that, LLVM is also used in open source projects, for example in Mesa and in the Dolphin Emulator for JIT compilation.
Aside from that, GCC still has predominant usage, for example, Linux is built using GCC and while there have been attempts to build Linux using Clang+LLVM, they were more of an experiement than anything. As well as that, in the embedded world, a lot of embedded applications (for example, UBoot and Little Kernel) rely on features provided by GCC extensions and outright won't build with Clang+LLVM failing either at compilation to objects or linking stages.
For userspace applications however, it's largely a matter of personal (or your company's preference) since both of them offer roughly the same feature set including stuff like SIMD support and full support for C++14 and C11 (though GCC has some annoying unresolved bugs when it comes to C++ support, for example, Bug 61636).
The code inspection techniques are largely provided by Clang and in my personal experience provided a substantial amount of overhead (for example in Qt Creator and less so in XCode).

Ruby Book recommendations for how it works under the hood? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm moving from .NET to Ruby, and i'm starting to get a pretty decent grasp on the language. However there's still a lot of things I want to know more about.
In C# one of the best books I read was called CLR via C#. It went into a lot more detail about how the CLR works, how memory works, garbage collection, reflection etc.
Is there an equivalent book for Ruby? Something that explains what the interpreter looks like under the covers?
There is no "the interpreter" in Ruby. Ruby is programming language, a programming language is an abstract mathematical object, a set of logical rules and restrictions.
There is an ISO specification for a subset of Ruby. There used to be a comprehensive set of executable examples written in Ruby, called RubySpec, but unfortunately, it was abandoned by its maintainers because of a lack of buy-in by the language designers of Ruby; however, several implementations still use it internally for their testing, e.g. Rubinius and JRuby. There is also a set of tests that are meant to specify the behavior of the language in the YARV implementation, which is the implementation that most of the language designers are hacking on.
There are several implementations of Ruby, however, none of those implementations is an interpreter, all of them have at least one, some multiple compilers:
Rubinius, a two-stage mixed-mode implementation consisting of a Ruby-to-bytecode-compiler written in Ruby, a kernel and core libraries written in Ruby, and a VM written in C++ with a bytecode interpreter and an LLVM-based JIT compiler.
Topaz, a two-stage mixed-mode implementation built with the PyPy framework consisting of a Ruby-to-bytecode compiler and a VM with bytecode interpreter and JIT compiler written in RPython, and a kernel and core library partially derived from Rubinius.
MagLev, a two-stage mixed-mode implementation built on top of the GemStone/S Smalltalk platform consisting of a Ruby-to-bytecode compiler and a more or less unmodified GemStone/S Smalltalk VM.
IronRuby, a two-stage mixed-mode implementation built on top of Microsoft's Dynamic Language Runtime and Common Language Infrastructure, written in C#.
JRuby+Truffle, a new implementation of Ruby based on JRuby and the Truffle AST interpreter framework.
JRuby, a two-stage mixed-mode implementation built on top of the Java platform, written in Java.
MRuby, a small, lightweight, embeddable implementation of a subset of the ISO Ruby specification. (This is the implementation that the creator of Ruby is working on himself.)
YARV, a two-stage implementation consisting on a Ruby-to-bytecode compiler and a bytecode interpreter, as well as a core library, all written in C.
Opal is a Ruby-to-ECMASCript compiler, which unfortunately does not 100% accurately implement the semantics of the Ruby language.
I have tried to order them from easiest to hardest readable sourcecode, and incidentally also (almost) from most to least interesting. (I think JRuby+Truffle is extremely awesome and should be right up there with Rubinius and Topaz when it comes to interesting ideas about how to make Ruby blazing fast.)
The reason why I ordered them from easiest to hardest readable sourcecode is because, well, there really aren't any books that describe the various implementations. Reading the source is probably your best bet. However, the classic Smalltalk-80: The Language and its Implementation (aka the Blue Book) was a heavy inspiration for the design of Rubinius. JRuby+Truffle, being a research project, has had a fair number of papers published, though.
There's a Ruby Bibliography Page which has some links to papers, mainly about JRuby+Truffle, but also about MagLev and JRuby.

Linux x86/x86-64 Fortran 90/95/2003/2008 compiler, which? and, why? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Well, I've been asking myself this question for quite a long time by now.
I started using the GNU Fortran compiler (gfortran) and I was quite happy. But then I started hearing that the Intel Fortran compiler (ifort) was better because it was optimized for Intel processors (and therefore optimized for most computers today as a consequence that Intel has the greater share of the market). After that I started using ifort, but the truth is that I'm not completely happy with it because it does not detect some errors that gfortran does (i.e. Question: "Reference passing is changing the values of a matrix").
It is also true that there are other Fortran compilers but, actually, I never use other than gfortran and ifort.
So I would like to ask you: What are the advantages and disadvantages of each one? Which is the best one, if optimization is not important?
In my opinion, it is best to stick to the Standard you're comfortable with, and write code that is conforming to this Standard. Then, the choice of compilers is dictated by the support for said Standard.
Here is an extensive list of the compiler support for the 2003 and 2008 Standards.
I myself used g95 a lot because I liked the debug messages. Nowadays, I commonly use Fortran 2008 features, and use gfortran (because it's open source), and ifort (because it's free for non-commercial use). g95's support for Fortran 2003 and 2008 is quite limited.
I usually compile code with both compilers and all warnings turned on, and quite often I'm surprised what errors are missed by one of the compilers. In terms of performance of the compiled code, I never noticed a difference (excluding bundled math libraries).
Most commercially available compilers have non-standard extensions, like OpenACC (e.g. Cray, PGI) or special features (e.g. PGI CUDA Fortran) and bundled libraries (e.g. Intel MKL). These might also influence your choice. For some hardware you might need / might profit from special compilers (like the Cray compiler).
EDIT: Here are some benchmark results for different compilers and machines.

What language can I use instead of Turbo Pascal? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I was using Turbo Pascal for about 20 years, but now I have changed my computer, and I have Windows 7 now. TP does not work under it. What similar language can I use instead of TP, that will require from me to spend minimum possible time studying it.
There is FreePascal:
http://www.freepascal.org/
It appears to be supported, I'm not sure how different it is to the Borland variant though.
Delphi is another option.
If you want to run the 20 year old Turbo Pascal on Win 7, you still can.
Download DosBox, and run TurboPascal in there.
http://www.dosbox.com/
Turbo Pascal evolved into Delphi, which is still used today but might be hard to find.
Your options are probably:
Delphi
GNU Pascal
Free Pascal
FreePascal has a switch for TurboPascal compatibility (so you will have no need to change your programming habbits), and it can generate DOS, WIN32, WIN64 and other executables.
Turbo Pascal to Delphi (~ object oriented Pascal) would seem like the natural choice / progression.
Although a lot of other languages today are relatively easy to pick up as well (Python, Ruby, etc...).
Yes, the natural progression would be to change to Lazarus/Freepascal or Delphi.
I strongly agree that you can still run TP if you liked, though.
However, it is a very good opportunity for an update. C# is a programming language that was developed by the creator of Turbo Pascal/Delphi, and indeed it has many features borrowed from Object Pascal.
If you choose C# development of Mono, you can use very modern GUI such as Monodevelop and create multi-platform applications with GTK# without any effort.
http://www.mono-project.com/Main_Page
http://monodevelop.com/
If you don't care about being multiplatform, you prefer to write software only for Windows, then you can choose Visual C# 2010 Express (its free):
http://www.microsoft.com/express/Downloads/#2010-Visual-CS
What kind of software do you expect to be able to write? Is this for professional development, hobby use,...?
If you are writing COTS software for Windows, I'd suggest one of the .NET languages. C# probably has the most publicly available tutorials, free code, controls, and such. Or learn Ruby and separate yourself from the crowd.
Maybe its time to learn C# or something. Its probably going to save you more time in the long run. However you could purchase embarcadero . This is a recent version of the pascal language that supports some more modern features like generics. Old pascal code bases are compatible with it. There's also oxygene which allows you to use all the advantages of .net with pascal like syntax.
There is of course also free pascal
Well, I learnt PASCAL (Turbo Pascal) during my secondary school just for OI.But I strongly recommend Free Pascal OR Delphi.
Reasons:
1.Absolutely support OOP(especially Delphi).
2.Support to compile your code by Turbo Pascal.
3.New functions:
(a).Opreator reloading.(like c++)
(b).Ansi String.(I think it is very important for NO-ENGLISH countries.
(c).IT IS A GOOD BRIGE FOR YOU TO LEARN OTHER OOP Languages like:C++,JAVA,PYTHON.
(d).The VLC(like MFC in visual c++) function is very strong,for example:Indy in Delphi(for Net programming);
4.Download Url:
http://www.freepascal.org/
http://www.embarcadero.com/cn/products/delphi
Python.
Cross platform, free, open source.
Has PyGTK, Tcl, wxWidgets and many more libraries for GUIs.
An application you write in Python will likely run well on all three main OSes (Windows, Linux, Mac) with little to no changes.
Python's syntax is similar to Pascal's but there are several important differences. For one, you don't define variables, and the types of variables are free to change. And there are no if ... then ... begin ... end statements as indentation is used.
It is also much more forgiving than Pascal syntax and type wise (not that that should be a reason for choosing a language!)
Because it is interpreted it will be slower. That can be a disadvantage for some applications, but it's usually not noticeable.
If you've learned Pascal well, then there are two ways: c++ (programming language that was written on Pascal) and Delphi (the reincarnation of Pascal).
C++ looks similar to Pascal, but it is more powerful.
Delphi uses VCL (visual components library), so you can create windowed applications very fast.
Good luck.

Mac OS System 1.0 Programming Language

I started my early days programming in a Macintosh 128k (I was 10) and I don't quite remember the programming languages used. Any one does?
I would like to know the different programming languages available at that time for that platform.
Thanks
Development was originally carried on the Lisa, using Pascal and assembler. Some time later native development environments started to appear for the Mac, e.g. TMS Pascal, MacPascal, Microsoft BASIC, MDS, and later, MPW, Think C, Think Pascal, CodeWarrior, etc.
Pascal was the original language for Mac OS programming, and all the documentation and APIs used Pascal, but there was a gradual migration towards C through the 1980s.
I expect Macintosh Programmers Workbench (MPW) which was a "worksheet" environment, mainly driven on the command line, used Makefiles - not dissimilar to Unix development, using Pascal as the main language.
I don't remember if Hypercard was available that early but that's another possibility.

Resources