5 ms·
Pascal was the more restrictive and more verbose language, whereas C had more expressivity and terseness. Most of what could be written in C, could be written i
by bluetomcat 3y ago
Pascal was the more restrictive and more verbose language, whereas C had more expressivity and terseness. Most of what could be written in C, could be written in Pascal, minus the hacky stuff.
- mickeyp 3y agoRestrictive how? You had full pointer control in pascal and could drop to assembly with the `asm' statement.
- wiz21c 3y agodropping assembly was the killer feature for me. It allowed to migrate gradually from a very easy to understand language to more performance code, without having to understand what a linker does.
- bluetomcat 3y agoPascal pointers are different animals. Since it is a strongly-typed language, juggling between ints and pointers or between pointers of different types is not allowed. Pointer arithmetic on a byte basis is also not straightforward.
- mickeyp 3y agoThat's... not true? You have `Pointer' for generic pointers and you can use `^' to indicate any type should be pointer based. You can then use Inc() or plain addressing plus arithmetic. And you can use `^' again on the right-hand side to dereference it. And you can certainly juggle between different types. You can cast things in Pascal.
- jhbadger 3y agoPascal was a lot like BASIC in that every version added their own (often incompatible) stuff because the official standard language was so limited. Certainly you couldn't drop down to assembly in standard Pascal -- that sounds like something Turbo Pascal added and may be present in modern versions because of the popularity of that.
- hnlmorg 3y agoIt’s less to do with limitations of the language and more to do with variations in compilers (each vendor wanting to add their own flair to sell their compiler) and a lack of standards. You saw the same with C and C++ before they were standardised.
- hnlmorg 3y agoThat’s a good thing. I do like C but there’s no denying that it makes it ridiculously easy to fuck up. Whereas Pascal enforces correctness. Some view that as annoying verbosity but you can’t please all the people all the time.
- pjmlp 3y agoOnly the ISO Pascal first edition, that barely anyone used outside of a teaching context, it initial purpose anyway. Also why Modula-2 exists since 1978.
- rvense 3y agoThe next major release of GCC will have a Modula-2 frontend. I look forward to trying that out. edit - Apparently it was released yesterday?
- pjmlp 3y agoYeah, now it only needs a VSCode plugin that does auto-formating (no need to explicitly type keywords in uppercase), and maybe some package management of sorts.
- ghaering 3y agoI have very fond memories of Modula-2. I hacked a lot of cool stuff with it (also with inline assembler) as a teenager. When I eventually switched to C and C++ because I was curious about learning, the overall experience was much worse due to the build system and much slower compile times. We were talking orders of magnitude here.
- DeathArrow 3y agoI was blown away when a colleague of mine wrote a little Pascal program which rebooted the computer in the lab. He wrote something at some memory address or port and the computer was running DOS.
- susam 3y agoDo you mean something like this? https://github.com/susam/reboot https://github.com/susam/reboot
- DeathArrow 3y agoProbably.