Most active commenters
  • EVa5I7bHFq9mnYK(4)
  • WalterBright(3)

←back to thread

71 points susam | 24 comments | | HN request time: 0.979s | source | bottom
1. HexDecOctBin ◴[] No.43673899[source]
Why is it that Pascal is supposedly so good for Rapid Application Development? Is it simply a historical accident, or does Pascal have some features that make it easier? What features would need to be added to C to make C a viable language for RAD?
replies(7): >>43673957 #>>43673971 #>>43674284 #>>43674335 #>>43674504 #>>43674573 #>>43676653 #
2. graemep ◴[] No.43673957[source]
I cannot see any reason why the RAD for Pascal (i.e. Delphi, and now Lazarus) could not exist for other languages. They just happen not to.

Imagine this - if those had not exists, would anyone say Pascal was a good RAD language.

I suppose what I might be missing is why Pascal was chosen as the language for Delphi.

replies(1): >>43673970 #
3. dardeaup ◴[] No.43673970[source]
One aspect of Pascal that helps is compilation speed. Pascal's nature allows for single-pass compilers. It may not sound like a big deal, but it's a huge cumulative effect.
replies(2): >>43674179 #>>43674237 #
4. codr7 ◴[] No.43673971[source]
Object Pascal as defined by Borland/Inprise/Embarcadero's Delphi has plenty of features that make it easier to build components. C++ Builder offers a similar experience. Straight C would certainly be possible, GTK is a step in that direction, but likely more awkward to use.
replies(1): >>43677916 #
5. graemep ◴[] No.43674179{3}[source]
That is a good point. Repeatedly waiting for compile of build steps is a productivity killer and I think especially relevant for RAD.

I played with Lazarus recently and the whole process of creating a simple GUI was so painless.

6. EVa5I7bHFq9mnYK ◴[] No.43674237{3}[source]
That definitely was a big deal in the 80s when I used it. You could compile a program in seconds, all in memory, while a C program needed 5 passes, each pass writing and reading from quite slow hard disks of the time.
replies(1): >>43674381 #
7. pkphilip ◴[] No.43674284[source]
There are many unique features of Object Pascal as used in Delphi which makes it very easy to write components in:

* Components have a support for customizable UI interfaces for setting the property of components called property sheets and these property sheets are applicable on a component level or at the level of individual property fields in the component. These property sheets show up when you are trying configure a component in the design mode within the IDE. We are not talking about simple text entry type of fields - you can actually do very sophisticated property sheets with tabs, multiple forms etc and what not. It is EXTREMELY configurable and also relatively easy to develop.

* Delphi uses a binary "form" file into which each GUI form persists its interface. So everytime you place a component on a form in the GUI IDE or set its properties, the form and its components have a way of persisting their values into this "form" file. The reverse also happens - so when a form is loaded into the IDE or during runtime, the form fields are read off the "form" file by the form and its components. So the actual .pas file where you are adding code for the events etc is not filled up with a lot of UI related property setting code and so the code looks really clean with clear separation of design and code.

* Components can be installed into the IDE during development very easily

replies(2): >>43676170 #>>43711496 #
8. AdrianB1 ◴[] No.43674335[source]
At the time it appeared, it was more powerful than BASIC or COBOL. We learned Pascal in college and even the technically less inclined colleagues were able to do the assignments pretty well. We used Turbo Pascal, which had a decent IDE, my brother also continued to use Delphi for another ~ 10 years and loved it for being so easy to do some quick and dirty things when needed. Honestly I don't remember almost any details after 30 years, other than it was simple to use and quick to learn and write something in it, while a lot more friendly than C or C++.
replies(1): >>43674360 #
9. api ◴[] No.43674360[source]
A huge amount of BBS software from the classic pre-Internet BBS era was written in Borland Turbo Pascal.
replies(1): >>43674457 #
10. WalterBright ◴[] No.43674381{4}[source]
My C and C++ compilers (Datalight, Zortech) only required 2 passes:

1. preprocessor/parser/semantic all at once

2. optimizer (optional)

3. code generator

Later on in the 80s these were merged into one executable.

replies(1): >>43680637 #
11. AdrianB1 ◴[] No.43674457{3}[source]
I ran a BBS for a few years in 1992-1994, at some point running under OS/2, but honestly I never bothered to find out the programming language used for it, there was no source code attached and all the software at that time was pirated.
12. pjmlp ◴[] No.43674504[source]
Easy, see C++ Builder.

Thing is, people complain about Borland/Embarcadero extensions, but love their GCC and clang ones.

13. bitwize ◴[] No.43674573[source]
Delphi and Lazarus have heritages that date back to, or are inspired by, Turbo Pascal and Object Pascal, both of which extended the language in useful ways to make it suitable for real-world use.

When we say "Pascal" today we speak of a much more ergonomic language than the Pascal of 1981.

14. badsectoracula ◴[] No.43676170[source]
One important aspect (since the topic is the language) is there is nothing special about components in Delphi and Lazarus - they are just built on the language's RTTI features.

In Free Pascal (and Delphi) all classes have a "metaclass" (a class that describes the class) and can be used in conjunction with the RTTI to obtain information about an object at runtime - including its actual class, exposed properties and any optional metadata (like attributes in FP).

This functionality is used by Delphi/Lazarus to serialize and deserialize objects on disk (the form files you mention are such serialized objects but you can serialize other types of objects and in Lazarus -perhaps Delphi too- you can use several file formats) as well as implement the object inspector.

In a way Delphi/Lazarus work kinda like how game engines like Unreal work in that you are working with "live" instances of objects, using generic object inspectors and saving them on disk is done by serializing them (though obviously it is the opposite since Delphi predates most game engines using this approach :-P).

The important aspect with all the above isn't so much the form/component serialization but the language features that make it possible in the first place: metaclasses and RTTI that provides enough information to instantiate and describe objects and classes at runtime.

My own game engine[0] is written in Free Pascal and Lazarus and uses the exact same language features to provide object serialization, property editing and some other stuff (like object diffing that is used for many undo/redo operations). Instead of TComponent/TPersistent (the types Delphi/FCL provide for serialization), it has its own base types that use a more compact file format, optional compressed streams (e.g. for texture data) and external references (for shared assets stored in separate files), but still relies on the same base functionality provided by the language/compiler.

[0] https://i.imgur.com/fypn318.jpg

replies(1): >>43678502 #
15. int_19h ◴[] No.43676653[source]
It has little to do with the language itself, moreso with the tools.

One thing that very clearly distinguished (extended dialects of) Pascal from C in the era where the two were competing was that Pascal's units were self-describing. That is, when you compiled a unit, you got a single file with all the metadata for that unit as well as binary object code for linking. Then, when another unit or program did a USES declaration, that would locate the file by name and use the metadata as needed. Conversely, in C you had to deal with header files, and while on the surface it looks kinda sorta like the INTERFACE section of the Pascal unit, it's not quite that because e.g. it needs to #include things it depends on - and that is textual inclusion, not just a metadata reference.

This all meant that working with dynamically loaded type information was much easier in Pascal tooling - it just needed to parse the metadata embedded in the compiled unit files, and each file would only contain metadata for its own types and functions, without contamination from other units that it relies on. This is great for things like code completion and visual UI designers.

16. robocat ◴[] No.43677916[source]
I would add that Delphi also had a culture of component libraries and sharing code.

There were free intro libraries (no code), shareware component libraries, and usually a developer version available that came with source code. Plus a culture of open source libraries.

This community was a key strength of Delphi compared to some other choices. I suspect if Borland had really leaned into a combination of open source, plus better support for commercial proprietary solutions, that would have kept the ecosystem alive.

Also of note is that Delphi came with some source code for library components (often useful when understanding usage or debugging or extending).

17. pkphilip ◴[] No.43678502{3}[source]
Cool! what is the name of your game engine? For some reason the imgur links are banned here in India and so not able to see it.
replies(1): >>43680208 #
18. HexDecOctBin ◴[] No.43680208{4}[source]
What ISP are you using? I am able to open the link on Airtel broadband and both Airtel and Jio cellular.
19. EVa5I7bHFq9mnYK ◴[] No.43680637{5}[source]
CPP

C0

C1

C2

AS

LD

And an optional AR

replies(1): >>43683462 #
20. WalterBright ◴[] No.43683462{6}[source]
I know what the conceptual passes are, but ZTC merged them, including the multiple conceptual passes the CPP does.
replies(1): >>43685021 #
21. EVa5I7bHFq9mnYK ◴[] No.43685021{7}[source]
Those were not conceptual passes, but actual standalone programs executed in that order, to compile a C program. Each program operated within 64KB RAM, shared with the OS and all the drivers.
replies(1): >>43685436 #
22. WalterBright ◴[] No.43685436{8}[source]
And Zortech C, for 64K machines, had two standalone programs to compile a C program to an object file.
replies(1): >>43686258 #
23. EVa5I7bHFq9mnYK ◴[] No.43686258{9}[source]
Cudos to Zortech C
24. CRConrad ◴[] No.43711496[source]
> Delphi uses a binary "form" file into which each GUI form persists its interface.

That's not necessarily binary. I don't recall if perhaps it was in Delphi 1 (the 16-bit version for Windows 3.x and Windows 95), but from Delphi 2 or 3 or so (released around the turn of the century), it could also save form definitions as plain text. oh, and of course since the height of the XML craze (shortly after the turn of the century?), in that format too.