13 ms·
Using the Free Pascal IDE for a Week
- jqpabc123 4y agoI'm not sure what the rationale is for maintaining the text mode FP IDE. It seems kinda quaint in 2022 to maintain a recreation of the old Turbo Pascal editor, but I'm so glad that it's there. I think you just answered your own question. It's there because it's functional and works on most if not all of the supported developer desktops. Of course, it won't win any beauty contest but I suspect most of those using it probably won't either.
- zozbot234 4y agoIt handily wins a beauty contest among TUI IDEs, though. The only reasonable alternative that even supports a similar workflow (with CUA-style keyboard bindings and all) is Emacs, and text-mode Emacs while fully supported is quite clunky.
- moron4hire 4y agoOne of the things I found interesting about TUIs is that it forces your design to be on a grid, defined in units of characters. It's easy to make a column of fields that all line up on edge. If you want any spacing between fields at all, it forces you to make that spacing fit to character-width grid cells. So, in a way, it's a little easier to semi-accidentally end up with a clean, good-looking design in a TUI, if someone is being just a little thoughtful about their layout, than it is to be in a full raster-based GUI with pixel- or percentage-based positioning. What I'd like to see are TUIs that embrace terminals running on large, high-resolution displays. We don't need to be constrained to 80 columns by 25 rows, or whatever.
- kwhitefoot 4y agoWhat stops you creating a text ui for more than 80x25?
- moron4hire 4y agoI mean more that I would like people to remember that the terminal can resize larger and develop more apps as TUIs.
- mikewarot 4y agoIt expands to fit your terminal size when it starts. I just had 150+ columns in mine. It doesn't handle resizes well, though.
- syntheweave 4y agoThere's a lot to be said in favor of gridded designs. Not only do they default to a clean look, they bias you towards static sizing, which means spending effort on the defaults. 80x25 grids with monospaced characters are pretty arbitrary of course. But you can use grids on top of other systems, it just gets more fiddly.
- buescher 4y agoEvery time I fire up fpc to fool around and think about whether I would actually do something non-trivial in Pascal (the answer is 'no') I also fantasize about a very opinionated, very non-standard, text-mode Linux distribution loaded with DOS-style TUI utilities and applications. Something like that would be fun to run on devices like old routers.
- marcodiego 4y agoA long time ago, a guy created a theme for gtk+ which used text characters to draw all the widgets. He also created a text mode gdk backend. Combine both: you have gtk+ apps running on the terminal.
- folmar 4y agoDo you have some link perhaps? I can't find it but would be really curious to try.
- marcodiego 4y agoHere: https://news.ycombinator.com/item?id=27886332 https://news.ycombinator.com/item?id=27886332 if you want a bit of history: https://web.archive.org/web/20060512213224/http://atrey.karlin.mff.cuni.cz/~pavel/cursed/cursed.html https://web.archive.org/web/20060512213224/http://atrey.karl...
- kevin_thibedeau 4y agoYou can do that with any distro today that has an optional windowing environment.
- buescher 4y agoI mean small and really opinionated - the goal would be a look and feel more like a bells-and-whistles DOS setup than like Unix. Inspired in part by https://prog21.dadgum.com/74.html https://prog21.dadgum.com/74.html
- 4y ago
- anta40 4y agoProbably because not all of them are interested in setting their own vim/emacs/etc.
- 1vuio0pswjnm7 4y ago"Of course it won't win any beauty contest but I suspect most of those using probably won't either." What does this mean. Does "those" refer to (a) "developer dektops" or (b) the people using them.
- CSSer 4y agoI think it was a joke. You know, a double entendre.
- falcolas 4y agoThis is your annual reminder than vim and eMacs are fully featured and extensible IDEs that support code completion, folding, and navigation by default. Or, no, you don’t need to use a graphical IDE to develop code, as TFA states. Thank you for coming to my Ted talk. EDIT: Don't believe me that VIM is an IDE? Read the threads for elucidation. :)
- rob74 4y agoIn the case of Free Pascal, may I remind you that there is a fully featured IDE called Lazarus which offers all of that plus an intuitive user experience (i.e. you don't have to memorize all the keystrokes before you can be productive, you can find the available commands in them menu and if you use one particular command a lot, you can memorize the keyboard shortcut) and a graphical tool to build your UI and connect it to your code.
- genezeta 4y agoLazarus is already mentioned and explained in the first paragraphs of the article.
- alwillis 4y agoIn the case of Free Pascal, may I remind you that there is a fully featured IDE called Lazarus… That’s cool, but if you already use Neovim for other things, there’s a Free Pascal Language Server Protocol (LSP) server for it too [1]. You’ll many of the same features that Lazarus has, like code completion, diagnostics, etc. In fact, it’s the same LSP that’s available for VS Code [2] and it uses Lazarus as a backend. Too much is being made about how hard Neovim is to configure; if you’re new to it or to Lua, just use LSP Zero [3] that takes care of all of the details of installing LSP, linters, etc. [1]: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#pasls https://github.com/neovim/nvim-lspconfig/blob/master/doc/ser... [2]: https://github.com/genericptr/pascal-language-server https://github.com/genericptr/pascal-language-server [3]: https://github.com/VonHeikemen/lsp-zero.nvim https://github.com/VonHeikemen/lsp-zero.nvim
- gnarbarian 4y ago
- kuu 4y ago* University flashbacks *
- forinti 4y agoAll the reference material I needed back then was a little folder with the grammar and and a list of the built-in functions.
- renewedrebecca 4y agoIt's kind of weird that the text mode IDE won't run on macOS. FPC/Lazarus themselves run fine there.
- Tozen 4y agoGood to see Pascal/Object Pascal getting some renewed love, after all the C/C++/C# wars. Way too many act like "there can only be one", versus explore and appreciate what various languages and tools have to offer.
- jksmith 4y agoOld days brought forward. Remember mark/release? With combo of code macros and open arrays using Lazarus/ FPC: mark_begin // after allocs,creates [parse1, sl1, sl2] mark_end ... lines of code ... release // end of proc, frees everything you marked allocated
- FpUser 4y agoI use Delphi and Lazarus just fine. Delphi for windows GUI applications and Lazarus for multiplatform GUI applications. I use multiple languages for various tasks and Delphi / Lazarus are hard to beat for quickly whipping out lean and mean GUI apps. As for "language being "cool" - I do not care what the general public thinks and use what gives me the best ROI for particular situation. Operating as a business really clears one's mind.
- memsom 4y agoWelcome to Delphi 1. My first job was using Delphi and it was 1.0 we used to do most of the dev till we managed to go 32bit (circa 1998) and the IDE had absolutely no autocompletion nor did it have any suggestions. You needed to know what you were typing. I think it was Delphi 3 that introduced Borland's version of code completion (I want to say it was called "Code Sense", but that might be the Microsoft tools.) Even that was terrible till Delphi 5. I think a lot of modern coders really forget how much you used to need to know. Even stuff like "jump to definition" wasn't a thing IIRC back then.
- noir_lord 4y ago> I think a lot of modern coders really forget how much you used to need to know. Even stuff like "jump to definition" wasn't a thing IIRC back then. Also came through that era, I don't miss it, modern tools are abstractions for the brain (and a logical progression from what we had before). Everything is so much bigger and more complex than it was (mostly because things are bolted together from a large number of libraries from different places with their own subtle or not so subtle conventions). In days of you had the languages standard libraries and libraries you wrote yourself and very rarely some Hallowed Third Party Library that was handed down on stone tablets by the Prophets of the Finance Department. Some stuff I miss, most I don't.
- marcodiego 4y agoSometimes I intentionally use primitive tools to force myself to write simple code.
- donretag 4y agoAutocomplete requires CPU cycles for the lookup and "jump to definition" requires an index to be built somewhere (CPU again, but also mem/disk space). Modern computers can handle both efficiently nowadays, but not a simple task back then.
- int_19h 4y agoMy memories of circa 1998 are rather different from OP. That's the year when Visual Basic 6 shipped, and that IDE had code completion working perfectly. Delphi 5 was out in 1999, and also worked great in that regard. Even C++ IDEs had code completion which worked decently well so long as templates weren't in the picture. Pascal/Delphi is actually almost a perfect language to write a smart editor around: the grammar is highly regular and requires minimal lookahead to parse, and definitions always precede usage.
- badsectoracula 4y agoSome notes. I assume this is for Linux, based on the beginning of the article. > It used to be possible to run a terminal session 'attached' to Lazarus, so that it could be debugged from the IDE, but since a previous update this always seems to fail on my PC. There could be some lingering settings. In my Lazarus build (from git, so it has the latest and greatest features and bugs) it is possible to run a program using a separate "launcher" from Run -> Run Parameters -> Check the "Use launching application" and then type something like "xterm -e some command that runs your app". In fact in my PC it pre-fills "/usr/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)" This should allow for debugging terminal programs from Lazarus. > I'm not sure what the rationale is for maintaining the text mode FP IDE. It seems kinda quaint in 2022 to maintain a recreation of the old Turbo Pascal editor. It provides a basic IDE wherever Free Pascal is available. Note that, e.g., Free Pascal runs on DOS, OS/2, AmigaOS, etc and the IDE works in those environments too (DOS support is also why the IDE "embeds" the compiler instead of calling out fpc.exe). It also works as a showpiece for Free Vision (also part of Free Pascal) which provides a TUI framework. Sadly, as it is based on the original Turbo Vision, it uses the old "object"-based types instead of "class"-based types, so it misses a lot of useful functionality for programming - but from a user's perspective it is IMO a perfectly fine TUI. > I'm not sure why this is the default setup, but you need to tell the IDE where to find the Free Pascal files on your system. This might be some installation problem, on a fresh install FP should be able to work out of the box. Perhaps some distro issue? Try to use the generic tar-based installer from the Free Pascal site and install it system-wide. > One of the main differences in the interface, compared to Lazarus, is that instead of a tabbed interface it has a series of windows. With the right font size, I actually prefer this interface as it means that I can see several related files on screen at once. Note that you can have multiple source windows with Lazarus too, right click on any tab and select "Clone in new window" and it will create a new source window you can have side by side with other windows (sadly you can't use Alt+number to switch between them though - but your window manager might be able to do that for you). This way you can have both tabbed and floating windows if you want. > The biggest thing that I'm missing so far is a good auto complete. The IDE will offer suggestions for completing Pascal keywords but, unlike Lazarus, it won't try to autocomplete your own variables or procedure names. And auto-completing function/procedure definitions, etc in interfaces section to the implementation section, and symbol renames, and a quick jumps to declarations or between the interface and implementation section for a function/procedure, and a bunch of other stuff :-P. It'd be neat if those were added at some point though. But i'm not sure how many people really work on the IDE nowadays, IIRC it used to be an external project that was merged with Free Pascal early in Free Pascal's history. I think nowadays even main FPC developers use Lazarus instead (note that despite being joined at the hip, Free Pascal and Lazarus are technically two different projects with each having its own development team). But having said that and regardless of the limitations, i wrote a very large part of Post Apocalyptic Petra[0]'s code in Free Pascal and the game can be compiled and debugged from the IDE just fine. I did eventually switch to using Lazarus when i started working on the editor though (since i needed the GUI bits) and the standalone "Petra Engine"[1] (which contains only the engine part of the game, slightly modified) is really meant to be used with Lazarus for development (you can build the standalone example game with just FPC though). [0] https://bad-sector.itch.io/post-apocalyptic-petra https://bad-sector.itch.io/post-apocalyptic-petra [1] http://xtra.runtimeterror.com/petra http://xtra.runtimeterror.com/petra
- GartzenDeHaes 4y agoSomeone mentioned the idea of a TUI VS Code the other day and I thought it was a great idea. Also, how about a text-only reboot of the web?
- mikewarot 4y agoProject Gemini [1] did just that. It's been mentioned here a few times. [1] https://gemini.circumlunar.space/ https://gemini.circumlunar.space/
- kwhitefoot 4y agoWe need a text mode browser that runs JavaScript properly. Are there any?
- salmo 4y agoIn a lot of ways neovim can be a TUI VSCode. It supports the language server spec and all that. It does require (kinda complicated) config. But you can steal examples from the internet. There's also the ecosystem of plugins to do fancier stuff like code snippets, menus, status bars, etc. But I don't do things like jumping to declarations with it. That's likely a thing with some plugin, I just don't know. I generally try to avoid traditional OO languages when I can. I used to use IntelliJ for those, but I have actually switched to VSCode for them and some of the things I've always used vim/neovim for, like larger Go projects. I make any IDE act like vim because my hands want to do modal editing. That's a thing where my habits impact my perceived ergonomics. If it doesn't support that, I won't use it. It's just too frustrating. I don't use Javascript except when I have to. If that's part of a TUI VSCode for you, then this may not be helpful.
- zozbot234 4y agoThe LSP, treesitter parsing, debug protocol etc. are good developments, but everything else in neovim is just way different from VSCode. And the vim modal editing pattern is nice for a basic text editor but has pretty poor extensibility compared to a menu-driven program - at some point you just can't do everything with single letters, you need actual, complex commands. So a real T-Vision/TUI conversion of VS Code might still be very worthwhile.
- haolez 4y agoThis would be very useful in a post-apocalipse scenario. Simple to use, simple to run, very powerful on what can be created with it :)
- maupin 4y agoI have a sudden nostalgia for my high school days using Turbo Pascal in the computer lab.
- ackfoobar 4y agoI was taught Pascal using the Free Pascal IDE, for OI competitions, in high school. I wish the teacher had made us jump into C++ directly.
- dbsmith83 4y agoI used to hack away with Delphi back in the day. I tried getting back into it with Lazarus, but I really find Pascal syntax painful to work with again for some reason. It just has some strange conventions and I feel like I'd have to actually read a book to become proficient. A very different experience than learning, say, Kotlin where I could essentially pick it up knowing other OO languages and having a good IDE
- squarefoot 4y agoI also worked with Delphi many moons ago and loved it, therefore also like Lazarus a lot, although I agree Pascal syntax could be made more modern. I recall one day I had to access data packets using the equivalent of C unions; the language allowed them, but the syntax was quite odd. Should one day Lazarus and the LCL be converted to other more popular languages, it would easily become a killer product.
- unnouinceput 4y agoPascal equivalent of C union is a variable record. Nowadays in Delphi (Free Pascal still doesn't have that) records can be used as classes, with their own members and just like classes, their functionality can be expanded using some sort of inheritance mechanism called "helper". Actually, in Delphi, the only difference between a class object and a record object is that classes allow dynamic allocation while records are instantiated on stack from beginning all the way to the end of the program. You should try Delphi nowadays, it has plenty of modern languages concepts implemented. Not to mention the compiler speed and the cross platform capability for all OS'es that matter.
- speed_spread 4y agoI just looked it up. The lowest-priced package is $1,599. A "Free Demo" doesn't interest me. I assume Embarcadero has some really good customers who are very satisfied with what they deliver. But they're not exactly cultivating a new user base with those terms.
- jll29 4y ago
- figital 4y agoFirst learned programming in Turbo Pascal and have fond memories of that IDE. Thanks for posting this. Would love to learn of a framework for reconfiguring this UX to do whatever I want (menus, scripting, etc).
- hurril 4y agoI also did that (and Turbo C++). Very fond memories!
- knodi123 4y agoHa, I remember ages ago, some guy in my computer science class was being a jerk to me, so when he wasn't looking, I leaned over to his Turbo Pascal IDE and spaced out past the right margin of the first line, and typed begin end. Which made everything below that in the entire file a comment. His program executed quickly, and never did anything, and you had to really pay attention to see the UI hint that suggested there was text to the right of whatever column was the edge. I thought it would be a good prank as a form of revenge, but he kept getting angrier and angrier and eventually I was too afraid to confess. The teacher had wandered over and was getting exasperated too. I think eventually they assumed he had a corrupted network drive and just nuked his entire network account and set up a new one with a new username, and now suddenly his compiler "worked" again. Heh.
- tomcam 4y agoI love that entire story
- glonq 4y agoDitto. Started with the fugly Turbo Pascal 3 IDE, but stuck with borland thru version 5 or 6, before moving on to mostly C/C++.
- pascal_wizzard 4y agoEven working with the 'modern' delphi ide makes intellij feel like advanced alien technology.
- Double_a_92 4y agoYeah it's horrible. Autocomplete randomly doesn't work. Debugging symbols randomly disappear, and you get thrown into an assembler view. Or even if it works, you can't see the values of variables sometimes. Sometimes it gets better by restarting the IDE...
- raydiatian 4y agoWow, I haven’t seen bright teal prompt text since MS DOS.
- pmontra 4y ago> when you want to do more than quickly update a few files, you need a full Integrated Development Environment (IDE). I remember that when I was developing with compiled languages ages ago (C and Java) I had an emacs configuration to compile and debug from within the editor. Eventually I gaved up emacs when writing Java and switched to Netbeans and Eclipse. Then I switched to interpreted languages (Ruby, Node, Python) and I'm using emacs again. Plain modes for those languages, no autocompleters except a very basic language indipendent one and it works like a charm. It also works like that with Elixir and Phoenix, which autocompiles itself. It's been probably 10 years since I installed an IDE on one of my computers.
- tmtvl 4y agoI think the main problem with trying to program Java in a text editor is the fact that we need to import every single package separately, or even worse: every class seperately. Doing Java programming in, say, Emacs would be fine if it weren't for import hell.
- Andrew_nenakhov 4y agoThe best feature I loved about TurboPascal was built-in help. Press Ctrl+F1 on any function name, and you are instantly taken to a very good help page, often with a working code snippet example!!! I can't overstate how insanely great it was, especially in pre-stackoverflow days!
- jll29 4y agoYou could hack the code of your favourite IDE (e.g. add a macro, modify the source) to google whatever is currently selected (e.g. WriteLn) by you with an additional qualifier site:stackoverflow.com for instance WriteLn site:stackoverflow.com So it would open up the top result of Google's SERP, i.e. https://stackoverflow.com/questions/617654/how-does-writeln-really-work https://stackoverflow.com/questions/617654/how-does-writeln-...
- Andrew_nenakhov 4y agoThere key difference with this approach is that in TP you had a very good help page, and here you get only the top result. Big difference!
- hulitu 4y agoAnd pray that that the answers on Stackoverflow are relevant.
- ralls_ebfe 4y agoI like using zeal-at-point in emacs, it is quite useful. https://github.com/jinzhu/zeal-at-point https://github.com/jinzhu/zeal-at-point
- 708733454927516 4y ago>I'm going to try and restrict myself to just using this IDE for the next week to see if I can still use it for my hobby project. So how did the test week go? (Just curious; I couldn't find an update...)
- smohare 4y ago
- BirAdam 4y agoTUIs are the best. Love ‘em.