23 ms·
Why use Pascal?
- stevekemp 3y agoI'm finding myself using Pascal for fun these days due to resource constraints. The old release of Borland's Turbo Pascal, version 3.00A, runs under CP/M and provides an editor, compiler, and libraries all under 64k. It's fast enough to use interactively, and produces code that is good-enough to implement low-level utilities, simple games, and other random hacks. I've not used Pascal on anything larger, or more modern, but I have to say that my recent experience has been rewarding enough that I wouldn't rule it out!
- netule 3y agoTurbo Pascal and later Delphi were the first time when a programming language really spoke to me. Eventually, I went the C and C++ route, but I’ve always had a desire to return to more expressive languages. I had no idea that there was still a modern Pascal implementation, so I may just have to get reacquainted with my first love.
- bluetomcat 3y agoI’ve also a had an early acquaintance with Borland TP 7.0 at the time C99 was already around, and Pascal felt rather clumsy in comparison. The strong typing, the lack of a preprocessor, the verbosity in data declarations, the small set of available libraries just made my early programming self consider C superior.
- baq 3y agoNowadays you look at pascal and see go without braces.
- fuzztester 3y agoCheck out Free Pascal (FP) if you haven't already. It supports many platforms. You can check on their site if it supports CP/M if you need that. I would not be surprised if it did. The TUI IDE is very similar to Turbo Pascal, and lightning fast. The language has a lot more (advanced) features than Turbo Pascal, but you don't have to use them if you don't want to. The generated binaries were also very small, similar to C, when I did a quick test of it on Windows, some time ago. Under 50 or 60 KB for a simple hello world program.
- stevekemp 3y agoSadly it seems not to be available for such systems. Though for reference compiling my sample "Hello World" script on TP gives me a "hello.com" file which is 8320 bytes. 64k is as much memory as I have on the machine, so if it were 50-60k I'd be worried there would be no space left for anything else!
- fuzztester 3y agoOh yeah, I realised that just after hitting submit. Had worked on almost as low powered machines a while, much earlier, as a hobby. Sorry for leading you down the wrong track. It looks like the broad cross-platform capabilities of FP are mainly for modern machines and platforms, even if low powered like the RPi.
- badsectoracula 3y agoFree Pascal has support for Z80 which might work with some CP/M systems (AFAIK Z80 is backwards compatible with 8080 and some CP/M systems used Z80). You need to compile the compiler from source but it apparently can target the ZX Spectrum, so with some modification it might be able to target CP/M too.
- mrlonglong 3y agoUse optimisation to get the binary down to 1k. I did just that yesterday.
- kragen 3y ago'under 60 kb' for a cp/m machine is like 'under 60 gb' for the laptop you're probably using
- brightsize 3y agoOh Pascal!, oh the nostalgia. I saved up the princely sum of $80-$100 back in TRS-80 Model III days to buy the Pascal 80 package, the New Classics version, which was basically a proto-IDE, and a pretty sweet one at the time. http://www.trs-80.org/pascal-80/ http://www.trs-80.org/pascal-80/ I recall it being a huge step up from the M-III BASIC dev environment and the games and utilities I wrote ran well enough in the 48K of RAM that was available. I wonder what became of the Pascal-80 codebase? Not that it would be any better than the modern tools available for retro hardware, probably far worse. Oh yeah, "Oh Pascal!" was the book from which I learned the language, and I doubt there were many other options, as this predated Pascal's commercial use by quite a few years.
- alwillis 3y agoAnyone can check out Oh! Pascal! [1] just like a library book. Even now, it's one of the best introductory programming books for any programming language. [1]: https://archive.org/details/ohpascal0000coop/mode/2up https://archive.org/details/ohpascal0000coop/mode/2up
- vram22 3y agoI was interested to revisit the book, but when I tried, it says: DOWNLOAD OPTIONS download 1 file ENCRYPTED ADOBE PDF download High Quality Page Images In order to access your downloaded book you will need LCP-compliant or Adobe-compliant software on your device. The Internet Archive will administer this loan, but Adobe may also collect some information. That's a turnoff.
- 3y ago
- zabzonk 3y agoI used Delph professionaly for several years in the 90s, and liked it, but really got tired with Borland (and subsequent owners) mis-managing the product and the language, as did Anders Hejlsberg, who left Borland for Microsoft, where he created C# - IMHO a much better language & architecture to invest your time in.
- FpUser 3y agoReliably deploying C# desktop app is total nightmare in comparison to single exe generated by Delphi's / Lazarus.
- xupybd 3y agoI've found .Net deployments to be rock solid and easy. What problems do you hit?
- wsc981 3y agoA couple of months ago I started working at a company that (mainly) develops C# libraries. The pipeline to deploy is complicated. Using a tool like ILMerge to combine DLLs into a single DLL (to prevent DLL hell issues). Using Babel to obfuscate the code base. Using nuspecs to create a Nuget package from the DLLs and various metadata. Signing the DLLs with some certificate. Then, if native stuff is included, also ensure the Nuget package can be deployed on all supported architectures. Probably some more stuff. Setting up a pipeline in Azure devops for a product I am working on, for the company, is already taking me a week and will probably take another couple of days to complete. But at least it’s a one-time task.
- zx14 3y agoWell, a lot of those requirements are highly bespoke to your task and to your team. My C# pipelines and C# apps are far easier to package and deploy than my Python apps for example. And, as you said, the pipeline is normally a one time cost.
- stuaxo 3y agoMisread this as Rascal and thought it would be about Turbo Rascal Syntax Error.
- eimrine 3y agoI have found a beautiful beginner book "High-Level Languages and Their Compilers" by Des Watson and I want to run all that examples which are given mostly on Pascal.
- tangus 3y agoI disagree with some of their reasons. Modern: Object Pascal isn't a modern language. It was modern in 1998, maybe, but it hasn't evolved much since then. Latest big change was the addition of generics, behind almost any other language. Fast: FPC doesn't generate particularly fast code, and the nature of OP objects doesn't help with locality. It's faster than scripting languages, but generally slower than AOT compiled languages, even those with GC. On the other hand, the ecosystem is great. There are lots of good libraries and tools (the most remarkable one being Lazarus, the Delphi clone). In my experience, people working with FPC or Delphi don't care much about modernizing the language or things like that, the just get things done (TM). I don't see the language being attractive to new coders though, so I don't know what its future will be...
- Svip 3y ago> On the other hand, the ecosystem is great. Hard disagree. I worked with Pascal for about 10 years, and the lack of modern libraries was a source of frequent frustration, meaning we often had to develop the solutions ourselves, or abandon an idea entirely.
- pjmlp 3y agoIn regards to Delphi there were plenty of them, sold by companies specialised in component libraries. Naturally one had to be willing to pay for them.
- kmoser 3y agoYep. Unless it's part of a legacy project, or I'm developing something as a fun experiment, I have no interest in languages that lack modern, robust, stable, up-to-date libraries.
- musicale 3y ago> I have no interest in languages that lack modern, robust, stable, up-to-date libraries. I guess JavaScript is out then. ;-)
- 3y ago
- mgaunard 3y agofirst word they use to justify using Pascal is that it's "modern". Gave a glimpse at the code source screenshot. No, that syntax is very much the past.
- hgsgm 3y agoWhat makes syntax "modern"? Power matters more than style.
- mgaunard 3y agoAll imperative languages are essentially descended from ALGOL, but in the case of Pascal, it also kept its original syntax. Others have moved on.
- coldtea 3y agoYes they have "moved on". Which is why Alsol was "a language so far ahead of its time, that it was not only an improvement on its predecessors, but also on nearly all its successors.” — Tony Hoare.
- fuzztester 3y agoToo good quote :)
- aap_ 3y ago- no struct/record type - call by name instead of call by reference - no bitwise operators - probably a lot more, I'm not too familiar with the language The quote may have been closer to the truth at some point, but certainly not today. And while begin/end syntax may be a matter of taste I don't think it's coincidence it's not very common anymore.
- coldtea 3y agoOf course it's not true today [1]. That's a 70s or 80s quote. But still, "moving on" is not always "improving upon" was the point. [1] Well, mostly not true (the author has backed down somewhat, but the post is still illuminating as a comparison): http://cowlark.com/2009-11-15-go/ http://cowlark.com/2009-11-15-go/
- _pferreir_ 3y ago[flagged]
- beefychops 3y ago[flagged]
- cvalka 3y agoWhy I prefer brainfuck.
- deleted 3y ago[deleted]
- squarefoot 3y agoMany people using Delphi back in the day will probably already know Lazarus, which is essentially an Open Source recreation which runs and compiles natively pretty much everywhere, Raspberry PI and similar ARM boards included. Installing libraries however can be tedious, therefore FpcUp and later FpcUpDeluxe were created to automate the task of installing the IDE along with other modules and some quite interesting addons. https://wiki.freepascal.org/fpcupdeluxe https://wiki.freepascal.org/fpcupdeluxe Here's a quick&dirty instrument panel widgets demo I just put together using some free widgets available with FpcUpDeluxe. https://ibb.co/9bchx7T https://ibb.co/9bchx7T FpcUpDeluxe does work also under Alpine Linux (get the musl version on the releases page), which opens possibilities for adding instrumentation panels to very small systems. All code is compiled native on various platforms, and runs fast: no interpreters, no web browsers etc.
- brnt 3y ago> free widgets Are you saying there are paid widgets? I use Qt5, which comes with more widgets than I know what to do with. Are the ones that come with Lazarus limited? Last time I tried Lazarus (and Delphi), Unicode was difficult. Everything seemed to assume ASCII.
- chadcmulligan 3y agoUnicode was fixed in 2007 (or thereabouts). I think thats a problem with Delphi (and Lazarus) everyone compares it to when they used Delphi (in 1999) it didn't do this cool thing that languages in 2023 do, however modern day Delphi does a lot more stuff. It's worth a revisit, I use it with the skia graphics engine to create multi platform apps very easily.
- brnt 3y agoI had to use Delphi professionally in 2018, still ran into this everywhere?
- chadcmulligan 3y ago
- khaledh 3y agoMy first project as a freshman in university was an elevator simulator (with text graphics) in Pascal. I enjoyed the language, there's something elegant about it when compared to C-like languages. This is the reason I'm enjoying Nim nowadays, which afaik is inspired by Wirthian languages (Pascal, Modula 3, Oberon, Delphi), in addition to Ada and Python.
- jmorenoamor 3y agoMy first languaje after BASIC was Modula2, which looks a lot like Pascal. I studied OOP, algorithms and data structures with Pascal in college, so it's a languaje for which I have great memeories. Nice to see it's still around.
- Rochus 3y agoModula-2 is a much better language than original Pascal, but if you want OO features Oberon-2 is the corresponding Wirth language.
- rurban 3y agoAnd it's the fastest language in the benchmarks game, whilst also producing the smallest code. Not only better than Pascal or Go, but even better than C++.
- igouy 3y agoModula-2 is not included? https://benchmarksgame-team.pages.debian.net/benchmarksgame/ https://benchmarksgame-team.pages.debian.net/benchmarksgame/
- Rochus 3y agoCan you post a reference, please?
- igouy 3y agoPerhaps https://dada.perl.it/shootout/modula2.html https://dada.perl.it/shootout/modula2.html
- Rochus 3y agoThanks for the link, though I don't think the fellow referred to that; it was last updated in 2003 and Modula-2 is far behind C or C++ (see https://dada.perl.it/shootout/craps.html); https://dada.perl.it/shootout/craps.html); and the results seem also quite questionable since Lua and Python are too good to be true.
- bradley13 3y agoWhy? Old languages must remain around for legacy support. However, it's hard to see the point of shoe-horning all those modern features into an old language. I write a lot of Java, and really, almost everything since Java 8 should not have been added. Lambdas, for example, are a kludge in Java. Want modern features? Use a modern language. If you want to stay in the Java ecosystem, for example, you could use Kotlin. I'm talking about Java only because I haven't seen Pascal for literally decades. I last programmed Pascal in the 1980s. Adding that laundry list of features to Pascal is just silly.
- valenterry 3y agoThen we have to switch PLs much more often. Seems reasonable to me to add/integrate new features that have proven to add a benefit to delay this process.
- thriftwy 3y agoOnly in the last few years we have a competing JVM language. Scala was a dead end. Clojure was a fad. Rhino/JS was very limited in its ambition. Java improvements allowed JVM to stay relevant and fend off DotNet, which is a good thing considering Microsoft's history.
- yawaramin 3y ago> Scala was a dead end. I'm sure all the companies, like Microsoft, Twitter, Disney, and basically every bank out there, will be very surprised to hear this.
- pjmlp 3y agoWhere does Microsoft use Scala? Or every bank out there?
- yawaramin 3y agoMachine learning: - https://github.com/microsoft/scala_torch https://github.com/microsoft/scala_torch - https://microsoft.github.io/SynapseML/ https://microsoft.github.io/SynapseML/ - https://www.infoworld.com/article/3236869/what-is-apache-spark-the-big-data-platform-that-crushed-hadoop.amp.html https://www.infoworld.com/article/3236869/what-is-apache-spa... And Microsoft of course owns LinkedIn which is built on a Scala backend.
- adastra22 3y agoFor the first couple of items on the list, Austral might be a language worth considering: https://austral-lang.org https://austral-lang.org It's new so it obviously doesn't have the community of libraries to use, but it does have a very friendly and accessible Pascal-like syntax, while also having a state of the art linear type system.
- thriftwy 3y agoAs you can see in the comments, Pascal has significant anti rating. I would meditate on that fact if I was Pascal evangelist, instead of reposting such texts over and over as years go by.
- thriftwy 3y ago[flagged]
- badsectoracula 3y agoI'm using Free Pascal for my 3D game engine (recent-ish screenshot[0]). For me there is really two main simple reasons: 1. Lazarus. A game engine is -waaay- more than just a 3D engine with the tools being a very important aspect. Lazarus and LCL provide a rich and well featured WYSIWYG RAD IDE and framework for making desktop applications. As a bonus Lazarus as an IDE (even ignoring the LCL framework) is very fast. 2. The language is decent and i know it. This is important because i'm not interested in learning a new language or framework or whatever while also making the engine, i want to focus on one thing. Also i have a lot of code written over the years to cherry pick (i started the project in 2020 but some of the code goes back to 2007-2008). And finally it has a strong aversion to breaking existing code - there is a culture of preserving backwards compatibility. Free Pascal is far from perfect though and TBH i'm annoyed by some of its constraints - some of them being quite pointless too IMO. For example the language has three ways to create compound types: records, objects and classes. They are almost all identical, except each one of them has limitations that isn't found in others, e.g.: 1. Records. They are like C structs. With "advanced records" language submode (enabled more functionality in a backwards compatibility preserving manner) they can also have methods, properties and "management operators" allowing the compiler to insert calls when things enter or exit the scope (so you can e.g. implement smart pointers, RAII or whatever). However they do not have any form of inheritance or virtual functions. They are value types and as such can be put in the stack, heap and their can be part of another compound type. 2. Objects. They are basically records with inheritance and virtual functions, though they cannot have management operators or some other record-only functionality like a variant section (allowing, e.g. functionality similar to C unions). They are also value types and can be put in stack, heap and/or be part of another compound type. 3. Classes. They are objects with extra functionality, have extra the bells and whistles like dynamic/message-based methods, a published section that expose properties and attributes via RTTI, etc. However they are reference types - they can only be allocated on the heap[1] and as such cannot be put in the stack and cannot be part of another type (only references can be stored). The thing is none of the above limitations have a technical reason - especially those between objects and records. In fact in the compiler source code all compound types are implemented with mostly the same code with some specialization checks here and there, it isn't like each of the above gets its own separate code path. But this is far from the only limitation. Another is that there is no way to expose a readonly view of an instance - something like C/C++'s "const" - so you can't -e.g.- have a mutable collection as a private field in a class that is exposed as an immutable one directly, so the compiler knows it can generate code for directly accessing the underlying field but not allowing any modifications to it. The weirder - and misleading - aspect is that the language does have some ways of specifying readonly views in some cases - specifically function parameters can use "const" or "constref" (the latter ensures a value is passed by reference, the former lets the compiler decide) which disallows the value to be modified. However if an object is passed like that you can still make method calls that mutate it even though you cannot assign it to another value, which kinda makes the whole thing feel only skin deep. On the topic of arbitrary limitations and types, there is also a weird limitation on properties: you can have property getters (and setters, but what i'll describe makes sense only for getters) be either fields or functions. For the former the compiler will generate code that'd be equivalent to accessing the field directly, for the latter it'd be a function call. When you define a property you also declare its type - but if you use a field as a getter it must much the type exactly, on the other hand you can have a function that returns a field as another type. This means that you cannot work around the "lack of const" limitation for collections by making a base class collection that only provides a readonly view and a subclass that allows mutation and then expose the mutable instance as its immutable parent class while letting the compiler generate code that access the field directly - you have to go through a function call and not only the compiler is very stupid at eliminating unnecessary calls, this also changes the RTTI data if you want this to be handled for -e.g.- serialization or via a GUI property editor. Also when it comes to RTTI which it is still better than what you'd get via -e.g.- C++ (i.e. nothing), it has limitations like only allowing primitive types (so if you have a class for a 3D object and you want to expose its position to be edited via a property editor that uses RTTI to figure out what to edit or to have automatic serialization and deserialization you cannot expose a "Position" property of a "Vector3D" type directly with the RTTI specifying what that "Vector3D" means and instead you have to specify separate "PositionX", "PositionY" and "PositionZ" properties of "Single" type (which is a primitive type for 32bit floats). You can still have a "Position" property of a "Vector3D" outside of RTTI and you can still use a private field of "Vector3D" to store the position and then use getters and setters beneath the scenes to access the individual vector fields for the "PositionX/Y/Z" properties. All of the above have the end results of using tons of -often inefficient- boilerplate to work around language limitations that in 99% of the cases have no reason to exist in the first place (aside from nobody implementing them - which would be fine, it is a free project, but the thing is the above are things the FPC developers refused to acknowledge as problems - in fact i personally tried to submit a patch that implemented the property case). As an example, in my 3D game engine i have a "dynamic array" generic (an incredibly common container you'd find in game engines) that i want to be able to allocate on the stack, heap or part of another object, i want it to separate allocation from number of elements (the language itself has dynamic arrays but they always allocate the same number of elements as the array has which means when you insert items you do a lot of allocations and deallocations - that not only fragments the heap but the FPC memory manager isn't that fast in the first place) and of course being able to automatically finalize (i.e. destroy) any managed objects (e.g. a dynamic array of strings with string being copy-on-write "smart" objects defined by the language itself). In order to get the "allocate on stack or part of object" i couldn't use classes, only objects or records. Because i wanted to expose it directly but without allowing mutation, i really could only use objects since records to not support inheritance. However objects do not support management operators so i'd have to explicitly initialize and finalize the objects. So the workaround there was to store the data in a separate type that is a record with management operators and specify a single field in the (immutable / readonly / base) object of that separate type so that when the object goes out of scope or is finalized itself, its contents are also finalized (remember that i mentioned how this is an arbitrary limitation? The compiler already knows this can happen and handles this, otherwise this workaround wouldn't work!). And also because i cannot have the mutable field accessed directly as its immutable/readonly base type, wherever i use it and i want to expose it i have to use a method getter which returns a pointer to the underlying field (but as the immutable type) - this is needed because otherwise the getter would return a copy of it (remember these are value types). [0] https://i.imgur.com/zzIH4dl.png https://i.imgur.com/zzIH4dl.png [1] (there are workarounds like using a proxy array with in-place initialization but they are very bug prone so i ignore them as they are not practical)
- snailtrail 3y ago</main>
- slavapestov 3y agoWe need to bring back Oberon. Fast compile times, automatic memory management, live environment.
- Rochus 3y agoOberon is even older than Delphi; a more modern version is Oberon+: https://oberon-lang.github.io/ https://oberon-lang.github.io/
- pjmlp 3y agoIt was great for its time, nowadays we would be better off having a similar experience based on Go, C#, D,...
- augustk 3y agoHere is the language specification: https://miasap.se/obnc/oberon-report.html https://miasap.se/obnc/oberon-report.html
- whatyesaid 3y agoUnless you want a C++ with a different syntax and less features then there's no reason to learn Pascal in 2023. And the syntax is much worse, you can't even declare variables in the middle of a function it has to go before the function. This slows you down from real work (art code comes later). It also makes worse code as declaring near the usage point makes code more clear.
- whobre 3y agoCan’t speak about Object Pascal, but the old Pascal was objectively better than C. You can like or dislike the differences in syntax, but Pascal’s type system was pretty solid which can’t be said about C
- bigbillheck 3y agoThe way I remember the pascal type system is arrays of different lengths were different types.
- filmor 3y agoThey are pretty much everywhere when statically allocated.
- zabzonk 3y agowell, not in c.
- Kamq 3y agoI believe they are in C, but arrays degrade to pointers when you look at them wrong, and _those_ don't have length as part of their type. At least I'm seeing: `array type 'int[3]'` in messages when I tried to do something wrong with it quick to get an error message (using llvm), maybe that's a compiler specific thing.
- 3y ago
- brd 3y agoI won't even bother clicking this click bait title. I learned Pascal as a sophomore in high school and by my senior year I knew I'd never touch it again. At the time it was a great introductory language but there's very little reason anyone should even be thinking about Pascal these days. Fun fact: I still have my old pascal files on floppy disks in a box somewhere with a not so thin layer of dust on them.
- dolmen 3y agoSame here. Including the fun fact.
- oaiey 3y agoI still think it is brutal we let our industry rookies learn complicated programming concepts in complicated languages like Java, python, js or god forbid anything functional. I still think it is a huge mistake be Microsoft to let Basic rot away and that our industry should focus teaching on something like Pascal which does not stand in your way
- pjmlp 3y agoVisual Basic 6 remains unmatched in how to deal with COM. It is incredible given how much WinDev doubles down on COM, that they keep failing on producing any kind of tooling that is as productive as the VB 6 experiece used to be.
- maleldil 3y agoDoes Pascal still require all variables to be declared at the top? I did a quick search and that seems like the case, but I want confirmation from someone that knows the language. If so, that's a immediate "no" for me. We know by now that keeping variable declarations close to their usage is a big boost in readability, and at times even in performance (you only declare variables you actually use). I know Pascal has evolved a lot over time. If this is indeed still a requirement, it's hard to understand why, and a barrier to those used to scoping in "modern" languages (even C99 has this).
- badsectoracula 3y agoDelphi allows inline variable declaration but Free Pascal does not (the developers explicitly decided against implementing it). Note that in Pascal (FPC, Delphi, whatever) you can have nested functions so this isn't that much of a limitation as it sounds. For example if i have a procedure that is very long i often end up splitting it in multiple nested procedures and each one has its own variable section. Also from a more practical perspective Lazarus (the most common FPC IDE) has a shortcut key to automatically insert variable declarations so you don't have to move up and down in code even if you have a large function body. I'd expect Delphi to have something similar.
- zabzonk 3y ago> Delphi allows inline variable declaration it may do so now, but for the longest time it didn't, which made it compare poorly with C++ and even with C, which allows definitions in a scope. in fact the OP concept of scope is a bit crap - basically the whole function,
- pjmlp 3y agoYour concept of Object Pascal scope is also outdated, in relation to Delphi.
- gaze 3y agoSeems a bit shallow. JavaScript equals is an abomination, which to me seems like a larger issue, and people use it just fine.
- oh_my_goodness 3y agoIn the future, if you ever create a teaching language, please point out clearly to the students that it's a teaching language.
- musicale 3y agoPascal is fairly isometric to a C subset (with a few exceptions such as sets, range types and indices, or printing out enumerated constants.) As a result there are readily available Pascal-to-C translators that produce working, compilable C code. Pascal isn't a memory safe language (e.g. use after dispose()), but the parts of C that are harder to mechanically translate into Pascal are often the unsafe bits.
- kazinator 3y ago> Why use Pascal? Because you like Niklaus Wirth's languages, and only those ... but only up to Pascal. You don't think that the improvements in his subsequent Pascal-like languages are Wirth a damn. You believe that Wirth went soft in the 1970's and 1980's, and sold out Pascal. If that is you, you probably write code in Pascal, implement Pascal, write about Pascal ... (Everyone else should probably skip Pascal and take a look at Modula-2 and Oberon.)
- badsectoracula 3y ago> (Everyone else should probably skip Pascal and take a look at Modula-2 and Oberon.) I did check out Oberon-07 because of its minimalism but i really couldn't get over the SHOUTY keywords :-P. (Wirth used uppercase for Pascal's keywords too but unlike Oberon, Pascal is not case sensitive - my pet theory is that Oberon is case sensitive as a reaction to Pascal programmers not using shouty capitalization :-P)
- Rochus 3y agoYes, forcing uppercase keywords is rather unfortunate; have a look at https://oberon-lang.github.io/ https://oberon-lang.github.io/
- kazinator 3y agoFor a "Loberon" dialect!
- kazinator 3y agos/For/Fork/
- augustk 3y agoI think the main reason for keywords being uppercased in Oberon (which is case sensitive) is to free up the space for user-defined identifiers. As long as the programmer sticks to lowercase and mixed case identifiers, new keywords and predefined procedures can be introduced in the language without invalidating old programs.
- jes5199 3y agoPascal was one of my first languages and I love it for that, but I can’t imagine going back to it. It never had a modern ecosystem and the OOP stuff was super janky
- riidom 3y agoQuestion for Castle Engine users: How is the file size when exporting to web, for an near-empty project?
- sacnoradhq 3y agoOften overlooked, the Ada embedded ecosystem has advantages of maturity in static analysis, debugging, and target support.
- musicale 3y agoI always thought that Ada was underrated. Personally I appreciate features like memory safety, a standard concurrency model, support for unit/measurement types, and ahead-of-time compilation. Ada's Pascal-like syntax seems verbose to me but isn't hard to read. And VHDL is based on Ada syntax, perhaps making it easier for people who are working in both languages. Swift seems to check some of those boxes (and adds many other convenient features including closures, automatic reference counting, type inference, etc.) I don't know about measurement types, but it seems they should be doable. There doesn't seem to be a Swift-like HDL yet though.
- bobajeff 3y agoDoes Ada support Android and iOS targets yet? Last I checked there didn't seem to be any obvious way to build for NDK.
- Jtsummers 3y agoiOS yes: https://docs.adacore.com/gnat_ugx-docs/html/gnat_ugx/gnat_ugx/ios_topics.html https://docs.adacore.com/gnat_ugx-docs/html/gnat_ugx/gnat_ug... Never used it though.
- sigzero 3y agoIt isn't the friendliest to get started on macos.
- Jtsummers 3y agoAlire mostly resolves that. It can manage the compilers you have installed. Much better than the situation a few years back. https://alire.ada.dev/ https://alire.ada.dev/
- deleted 3y ago
- Lerc 3y agoI used to use Delphi/Pascal as my main language. In the last decade or two I have been on a bit of a journey looking for a language that feels right to me. I used Haxe for quite a while but I felt Haxe fell into the trap of 'There's a Macro for that' (Macros can do anything, but ultimately enough macros make everyone programming in their own macro augmented language). JavaScript developed decent improvements (but could still use more) and I do a lot of stuff there now. A year or three ago I was writing some 8-bit AVR code and I gave FreePascal another go. I found it extremely enjoyable. I got to use the newer features and it felt like a truly modern language. Part of what made it so enjoyable was that because I was coding for a tiny space I was not using most of the standard library and just building custom specific code as I went. This meant I did not have the layers of backwards compatible namespace clutter that FreePascal has accumulated over many years (TList, TFPList, TFPGList, TFPGObjectList etc. My main pain point was that the compiler did not allow constant floating point expressions on a target without an FPU(or emulation). Since these could be done at compile time it would have been nice. Having worked in other spaces, I do now find the inability to define variables mid function to be restrictive, being able to have sub-function scoping is nice too. Begin End vs { } doesn't really bother me. I think I now prefer case sensitive languages and would rather not have letter prefixes on types. I think this is more due to the advancements in editors than anything. Syntax highlighting and active linting can remove text clutter by moving information into separate domains. I would probably be quite enthusiastic for a descendant language of FreePascal that had a clean slate approach. A new standard library that used the newest features as first class citizens. Maybe when I retire I'll have a go at it.
- dolmen 3y agoI see Go as a direct competitor to Pascal, in particular for all the points mentioned in the article. But Go has a modern runtime (with garbage collection), a modern ecosystem (with major libraries such as HTTP and TLS in stdlib) and an active community.
- oaiey 3y agoI do not. Co-routine thinking is more complex than imperative coding regarding the teaching aspects. Java and more concrete C# are the one who took Pascal and Delphi originally out of the game for day to day programming. And Go is already so much more popular than Pascal for real life work, that competition is a really the wrong word.
- didip 3y agoPascal is actually good and perfomant. It was the second language I picked up in high school after Basic. I don’t understand why as an industry we had to regress to Python, Ruby, Java, & Javascript in late 90s & early 2000.
- dansalvato 3y agoI saw a talk that touched on this recently: https://www.youtube.com/watch?v=Tml94je2edk https://www.youtube.com/watch?v=Tml94je2edk He explains that dynamically-typed languages like Python, Ruby, and JS became popular in the 90s because they offered a fast feedback loop for website building, and they didn't need an IDE or compilers, which were slow (and often not free). It ended up not being worth trading your development time for the performance increase when all your users were connecting via 56k modem anyway. The talk makes a lot of other cool points about how development has changed in the past decade or two, and why the trend is moving back to static typing.
- oaiey 3y agoDo not forget Pearl.
- fuzztester 3y agoYes, it is a gem of a language. Now, I wonder who its mother is?
- musicale 3y ago> gem of a language PP already mentioned Ruby.
- unixhero 3y agoPerl or Rakudo?
- musicale 3y ago> I don’t understand why as an industry we had to regress to Python, Ruby, Java, & Javascript in late 90s & early 2000 Computers got faster and added more memory, so they had to come up with a use for it. ;-) Also the web browser became a popular programming platform and mainly used JavaScript. They're still trying to cram a full OS into web browsers in addition to the browser part. Chrome is getting close.
- applesan 3y agoPascal and Logo Turtle are programming languages I learned at school, but never used them outside of it. I hated them back then. I don't know if this was teacher or language fault, but these IT lessons couldn't be more boring and confusing.
- oaiey 3y agoTeacher and kids not being focused. I learnt using Pascal and it was perfect.
- einpoklum 3y ago> modern, readable, fast, type-safe, cross-platform programming language Let's assume this is all true (although I wouldn't say it's particularly modern, and I don't know about some of the rest). And let's forget that some of these adjectives are relative or subjective. Even under that assumption - there are other programming languages which meet these criteria. Why would we prefer Object Pascal over them? Especially when it has existed for many years and not gotten a lot of traction?
- AnimalMuppet 3y ago"For those who like this sort of thing, it is the sort of thing they like." - attributed to a number of people. There are other languages which meet these criteria. But if Pascal fits the way your brain works, then it does. So use it. And if it doesn't fit the way your brain works, then don't. People are different. It doesn't hurt to have different tools.
- Havoc 3y agoI wouldn't use it. ...but I'm kinda glad Delphi was my first language. I feel it primed my thinking along helpful lines - typed & pretty rigidly structured. Spent a lot of time in python since which always felt a little..fuzzy for lack of better word. Recent took up Rust and had a bit of a "oh this feels familiar" moment. Clean and unforgiving.
- nurettin 3y agoSeeing devexpress components in Lazarus would be a dream come true.
- fuzztester 3y agoRelated, and of interest, IMO: Delphi – why won't it die? (2013) https://news.ycombinator.com/item?id=7613543 https://news.ycombinator.com/item?id=7613543
- Tozen 3y agoThe funny thing about that, is here we are in 2023. Lots of its competitors and haters are likely still asking, "Why won't it die?" TIOBE index has Delphi/Object Pascal ranked at #11. That's ahead of "top players" like Go, Rust, and Swift.
- pjmlp 3y agoIn Germany we keep having a Delphi / C++ Builder developers conference, and maybe due to their relation to Anders, it is not surprising to see related articles on the .NET Developers Magazine.
- mardifoufs 3y agoToo bad the TIOBE index is not representative of the real world. And it certainly won't get you a job either. If I had to chose between go/rust and pascal/Delphi for a healthy ecosystem or for job offers, I know which one I would chose. Especially early in a career. Ok maybe rust jobs aren't so common either, but swift and go are for sure. And that's not even mentioning the de facto vendor lock in when using Delphi in most professional settings.
- Tozen 3y agoTIOBE is arguably the most reliable one, though all of them are arguably flawed in various ways. Not saying the other languages mentioned don't have jobs, they are after all "top 20" languages too. But, Pascal/Object Pascal/Delphi is around a lot more and has more opportunities than many might be thinking. Especially from a worldwide point of view, and not just for the U.S.A Pascal/Delphi is still taught and used in a lot of schools around the world. While Go, Rust, and Swift are not. There are still massive amounts of legacy projects and code, not to mention Embarcadero is still selling Delphi and doing well enough to stay in business. I think the mistake that some make is the time frames that it takes to displace older and previously popular or dominant languages. Popular this year or a few years, does not usually and instantly erase that some other language was popular for 20 or 30 years. People run around saying COBOL, or even languages like Ada or PHP are dead, yet various institutions and companies are begging for programmers that know them. Those claiming a language is "dead", can be quite suspect too, because they are competitors who "wish" it to be so. "Is dead", "wish it was dead", or promoting sites "claiming the competitor's language is dead" are clearly a bit different. Because a language is popular this year, does not necessarily offset all the years that an older language was popular and in use. Lastly, Object Pascal/Delphi did not just fall completely off the charts either or stopped being used at all. It stills maintains significant levels of competitive popularity around the world.
- zzo38computer 3y agoPascal isn't too bad; actually I think that it has some advantages over some more modern programming languages. It isn't perfect though and does have disadvantages too. I sometimes use for Pascal and BASIC for DOS programming; Pascal does look OK for that, at least (and C seems not as good for DOS programming (at least in real mode), even though it is sometimes done). However, for programming in Linux, I generally prefer C (although I also use PostScript; I think that both C and PostScript have some advantages compared with some more modern programming languages). Pascal can be used for other programs too; even TeX is written in Pascal.
- haolez 3y agoWhat's your use of Postscript? I find fascinating when people use it for anything other than print related stuff
- zzo38computer 3y agoI think that it is not such a bad programming language. I have used it for both graphical and nongraphical stuff. For example: - A library to read/write the ZZT file format. I had then also used it to make a program which will draw a graphical map (I also defined a "PCEncoding" vector, although some characters seems to not work somehow). I had also done other things with it that are not graphical, including constructing ZZT world file automatically or making batch modifications to existing world files. - A library to parse a UHS hint file. Later, a program could also be written to allow it to be printed out, perhaps even using invisible ink or scratch-off layer if you have a suitable printer. It could also be used for interactive mode without printing. - I wrote a program to convert the levels from a DOS game into the Free Hero Mesh level import format, in PostScript. (A similar thing can be done to convert levels from other games, I suppose.) - I wanted to measure the computer's temperature and load over time, so I wrote a program in C to write the measurements to a file (just simple binary data with fixed length records) and then wrote PostScript program which will plot it on a graph and make a PNG file. - I also implemented getopt and JSON and multicodec in PostScript. I don't use JSON much, although I do use the getopt implementation sometimes. - I wanted to write a Pokemon battle simulator in C. I had used PostScript to manage some of the configuration-related stuff that is used before the program is compiled. As a side-effect, it can also make the type matchup charts in PNG as well (in addition to producing the files in the format used by the battle simulator I wanted to write), so now I have those as a reference even when playing a different game. - I also implemented Infocom's Z-machine in PostScript, although that is mostly just to see if I can. It implements both interactive mode (without the printer, using standard I/O), and the transcript (with the printer). Nevertheless, there are some things I would improve in PostScript. For example, add a "unread" operator (similar to ungetc in C), a built-in procedure called "#!" which just skips the rest of the line from the source file (the following slash is a new token in PostScript (which will be skipped by this procedure) so this will work), optional auto-allocation for stuff such as "readline", making warning/diagnostic/error messages on stderr instead of stdout (although "print", "=", "==" would still write to stdout; you can use "write==" etc to write to other files, but being able to do this with "pstack" would also be useful), and some other stuff. (Some of the stuff in Ghostscript is good, such as the ARGUMENTS array; that is probably the feature of Ghostscript which I use most often. %pipe% is also useful.)
- timwaagh 3y agoWhat I don't really like about Pascal is it's pretty verbose. It was originally for educational purposes so everything is very explicit.
- NikkiA 3y agoI'd rather use Oberon or Modula-3 if I have to use an algol style procedural language. But really, I'd rather use a modern lisp.
- quirkyfalse 3y ago[dead]
- potter092 3y ago[dead]
- calvin982 3y ago[dead]
- calvin982 3y ago[dead]
- slack92 3y ago[dead]
- slack92 3y ago[dead]
- henry02 3y ago[dead]
- harry829 3y ago[dead]
- harry829 3y ago[dead]
- potter092 3y ago[dead]
- kitty234 3y ago[dead]
- kitty234 3y ago[dead]
- bulk91 3y ago[dead]
- bulk91 3y ago[dead]
- soninlaw01 3y ago[dead]
- soninlaw01 3y ago[dead]
- tyson32 3y ago[dead]
- tyson32 3y ago[dead]
- henry02 3y ago[dead]
- cat982 3y ago[dead]
- cat982 3y ago[dead]
- cripto34 3y ago[dead]
- cripto34 3y ago[dead]
- chok823 3y ago[dead]
- chok823 3y ago[dead]
- dear923 3y ago[dead]
- dear923 3y ago[dead]
- tom323 3y ago[dead]
- tom323 3y ago[dead]
- jerry2398 3y ago[dead]
- jerry2398 3y ago[dead]
- face789 3y ago[dead]
- face789 3y ago[dead]
- happy23 3y ago[dead]
- happy23 3y ago[dead]
- sad9034 3y ago[dead]
- sad9034 3y ago[dead]
- help9873 3y ago[dead]
- help9873 3y ago[dead]
- valentina902 3y ago[dead]
- share342 3y ago[dead]
- share342 3y ago[dead]
- right32 3y ago[dead]
- right32 3y ago[dead]
- manyyears23 3y ago[dead]
- manyyears23 3y ago[dead]
- old322 3y ago[dead]
- old322 3y ago[dead]
- today9872 3y ago[dead]
- today9872 3y ago[dead]
- day92 3y ago[dead]
- day92 3y ago[dead]
- valentina902 3y ago[dead]
- pink8091 3y ago[dead]
- pink8091 3y ago[dead]
- red92 3y ago[dead]
- red92 3y ago[dead]
- cosmonaut034 3y ago[dead]
- cosmonaut034 3y ago[dead]
- bye892 3y ago[dead]
- bye892 3y ago[dead]
- black92 3y ago[dead]
- black92 3y ago[dead]
- white91 3y ago[dead]
- white91 3y ago[dead]
- green23 3y ago[dead]
- green23 3y ago[dead]
- people243 3y ago[dead]
- people243 3y ago[dead]
- dad82 3y ago[dead]
- dad82 3y ago[dead]
- mom82 3y ago[dead]
- mom82 3y ago[dead]
- momy02 3y ago[dead]
- momy02 3y ago[dead]
- crazy823 3y ago[dead]
- crazy823 3y ago[dead]
- place821 3y ago[dead]
- place821 3y ago[dead]
- henry903 3y ago[dead]
- henry903 3y ago[dead]
- father93 3y ago[dead]
- father93 3y ago[dead]
- brother82 3y ago[dead]
- brother82 3y ago[dead]
- thomas7812 3y ago[dead]
- thomas7812 3y ago[dead]
- night32 3y ago[dead]
- night32 3y ago[dead]
- dark232 3y ago[dead]
- dark232 3y ago[dead]
- alex82 3y ago[dead]
- alex82 3y ago[dead]
- friend22 3y ago[dead]
- friend22 3y ago[dead]
- classmate82 3y ago[dead]
- classmate82 3y ago[dead]
- day821 3y ago[dead]
- day821 3y ago[dead]
- funny921 3y ago[dead]
- funny921 3y ago[dead]
- throughchanging 3y ago[dead]
- throughchanging 3y ago[dead]
- straymedal 3y ago[dead]
- straymedal 3y ago[dead]
- creepydancer 3y ago[dead]
- creepydancer 3y ago[dead]
- failbank 3y ago[dead]
- failbank 3y ago[dead]
- singhas 3y ago[dead]
- singhas 3y ago[dead]
- binnaclegrade 3y ago[dead]
- binnaclegrade 3y ago[dead]
- elevator1 3y ago[dead]
- elevator1 3y ago[dead]
- worried46 3y ago[dead]
- worried46 3y ago[dead]
- sproutscentral 3y ago[dead]
- sproutscentral 3y ago[dead]
- tritebiohazard 3y ago[dead]
- tritebiohazard 3y ago[dead]
- adultfungus 3y ago[dead]
- adultfungus 3y ago[dead]
- doppingwindlass 3y ago[dead]
- doppingwindlass 3y ago[dead]
- tablewomanly 3y ago[dead]
- tablewomanly 3y ago[dead]
- mouthguard 3y ago[dead]
- mouthguard 3y ago[dead]
- accurate12 3y ago[dead]
- accurate12 3y ago[dead]
- hootzebra 3y ago[dead]
- hootzebra 3y ago[dead]
- quirkyfalse 3y ago[dead]
- perceivestark 3y ago[dead]
- socketestimate 3y ago[dead]
- socketestimate 3y ago[dead]
- ebaycheck 3y ago[dead]
- ebaycheck 3y ago[dead]
- priestlifestyle 3y ago[dead]
- priestlifestyle 3y ago[dead]
- partyflotilla 3y ago[dead]
- partyflotilla 3y ago[dead]
- deardvd 3y ago[dead]
- deardvd 3y ago[dead]
- perceivestark 3y ago[dead]
- toyotaraccoon 3y ago[dead]
- toyotaraccoon 3y ago[dead]
- sprite343 3y ago[dead]
- sprite343 3y ago[dead]
- drillcringle 3y ago[dead]
- drillcringle 3y ago[dead]
- reallynatural 3y ago[dead]
- reallynatural 3y ago[dead]
- nagplatform 3y ago[dead]
- nagplatform 3y ago[dead]
- oilsweet 3y ago[dead]
- occipital46 3y ago[dead]
- occipital46 3y ago[dead]
- welloffaffair 3y ago[dead]
- welloffaffair 3y ago[dead]
- simplicity34 3y ago[dead]
- hugtinkle 3y ago[dead]
- hugtinkle 3y ago[dead]
- oilsweet 3y ago[dead]
- simplicity34 3y ago[dead]
- likeable53 3y ago[dead]
- likeable53 3y ago[dead]
- noneadventure 3y ago[dead]
- noneadventure 3y ago[dead]
- scarfhockey 3y ago[dead]
- scarfhockey 3y ago[dead]
- exactlyponie 3y ago[dead]
- exactlyponie 3y ago[dead]
- original453 3y ago[dead]
- original453 3y ago[dead]
- salesunbonnet 3y ago[dead]
- salesunbonnet 3y ago[dead]
- tearful34 3y ago[dead]
- tearful34 3y ago[dead]
- second435 3y ago[dead]
- second435 3y ago[dead]
- thrusheentry 3y ago[dead]
- thrusheentry 3y ago[dead]
- fiery675 3y ago[dead]
- wrenfreeboard 3y ago[dead]
- wrenfreeboard 3y ago[dead]
- motorcycle3 3y ago[dead]
- motorcycle3 3y ago[dead]
- momentous13 3y ago[dead]
- momentous13 3y ago[dead]
- caughtenemy 3y ago[dead]
- caughtenemy 3y ago[dead]
- fiery675 3y ago[dead]
- staleleotard 3y ago[dead]
- staleleotard 3y ago[dead]
- skatingcrackle 3y ago[dead]
- skatingcrackle 3y ago[dead]
- podmazipan 3y ago[dead]
- podmazipan 3y ago[dead]
- tdy_err 3y agoPascal was the first prog language I ever learned as a 12-y/o kid. It's been almost twenty years. Shoutout to everybody from Kaitnieks who was scripting SCAR in Pascal to macro old RuneScape- how time does fly…