<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 10/17/24 10:01 PM, Santi via
fpc-pascal wrote:<br>
</div>
<blockquote type="cite"
cite="mid:f52edf18-ffd5-4304-8c63-26cdcabba4a5@ciberpiula.net">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="moz-cite-prefix">El 16/10/2024 a las 05:12, Joao Paulo
Schwarz Schuler via fpc-pascal escribió:<br>
</div>
<blockquote type="cite"
cite="mid:CAJbKcepV4hD60pFnioyy+o77bzyQYYYBs-0FLhp6TJdry13otQ@mail.gmail.com">
<meta http-equiv="content-type"
content="text/html; charset=UTF-8">
<div dir="ltr">Some half baked ideas:
<div>* month after month, the percentage of code coded by AI
grows and human made shrinks.</div>
<div>* could Pascal be the ideal language coded (or preferred)
by AI?</div>
<div><br>
</div>
<div>Given that Pascal is strongly typed, easy to read and
debug, avoids many types of bugs, could we make AI to prefer
pascal? <br>
</div>
</div>
</blockquote>
<br>
Pascal opened the path with structured programming and hard typed
languages. <br>
<br>
But most languages nowadays are hard typed: Java, rust, go, c#,
swift... c is here to stay, but modern language got rid of c-like
types byte=char=bool=everything. In fact modern development uses
tools to control types in c and c++. <br>
<br>
I'm sorry to say than other language are better, handier without
sacrificing security and readability.<br>
</blockquote>
<p>On the contrary, I've used some of the so called "modern"
languages and found them to be inferior to Pascal in some regards.
Especially, if you include things like runtime performance,
compilation speed, IDE experience, ease of writing code, etc. I've
used C, C++, Java, C#, Nim, Rust, Python, JavaScript. They all
suck. C# and Nim come close to being good, but still have
drawbacks.</p>
<p>C# is slow and bloated and I don't like the fact that it forces
you to use classes always, like Java. On the other hand, C# has an
excellent IDE experience, but only for Windows.</p>
<p>Nim is nice from a language design point of view, however it has
slow compilation speeds (compiler generates C code), bad IDE
experience (VS Code plugin), bad debugger experience (compiler
generates C code, debug info is generated for the C code, not the
Nim code), not a lot of libraries (and they lack stability), not a
very stable language (new versions break compatibility, especially
major versions), not a very advanced OOP support (supports
inheritance and virtual methods, but e.g. no interfaces), the
module system is also inferior - no interface and implementation
parts, no way to tell if something is a unit, or a program, etc.
The powerful macro system is a pro, but also a con, because it's
so easily abused by bad programmers.</p>
<p>The other languages are not even worth discussing, IMO. I know
Rust has a lot of fans. I've been writing Rust professionally for
almost a year now, and still find it to be one of the most
unpleasant languages to write code in. The borrow checker is
certainly not something I want to see in other languages. Anyhow,
it's a feature that is very unlikely to creep into Pascal, IMO. If
I have to do manual memory management, I prefer Object Pascal's
explicit way, instead of languages that hide it for you (by using
the RAII idiom or the borrow checker), and then still expect from
the programmer to fix things, when the automatics fail.<br>
</p>
<blockquote type="cite"
cite="mid:f52edf18-ffd5-4304-8c63-26cdcabba4a5@ciberpiula.net"> A
few points:<br>
<ul>
<li>Concurrency as part of the syntax of the language</li>
</ul>
</blockquote>
What do you mean? Do you mean stuff like OpenMP or is it something
else?<br>
<blockquote type="cite"
cite="mid:f52edf18-ffd5-4304-8c63-26cdcabba4a5@ciberpiula.net">
<ul>
<li>Declaring a var when you need it</li>
</ul>
</blockquote>
<p>Not a huge fan, but AFAIK latest Delphi has it, so we probably
need to support it in FPC. Anyhow, it's cosmetic at best. It's not
some "quality of life" type of issues, like the slow C++
compilation times, or the encouragement of buffer overflows. When
I need to use a local var declaration, I usually consider that my
procedure or function has become too complex and split it into
nested procedures. Also, Lazarus declares the variable
automatically for you, when you press Ctrl+Shift+C, so it's even
less of an issue. You just write:</p>
<p>i := 1;</p>
<p>Or:</p>
<p>for i := 1 to 10 do<br>
</p>
<p>You then move the cursor on top of "i" and press Ctrl+Shift+C and
it declares a "i: integer" automatically in the local var block.
And yes, it does automatic type inference.<br>
</p>
<blockquote type="cite"
cite="mid:f52edf18-ffd5-4304-8c63-26cdcabba4a5@ciberpiula.net">
<ul>
<li>Tuples, so easy to return two values</li>
</ul>
</blockquote>
Nice in theory, but I've used tuples in other languages and always
hit some roadblock. For example in Rust, I've had to switch from
using tuples to using structs several times, because of some
language quirks, that doesn't handle tuples somewhere. Anyhow, the
lack of tuples is only cosmetic, it's not a serious "quality of
life" issue. It's easy to declare a record type with two elements,
or an array.<br>
<blockquote type="cite"
cite="mid:f52edf18-ffd5-4304-8c63-26cdcabba4a5@ciberpiula.net">
<ul>
<li>Some functional programing</li>
</ul>
</blockquote>
Not a huge fan of functional programming either (out of the big
three - procedural programming, object oriented programming,
functional programming, I consider functional to be the least useful
- worst in performance, does not map well to how the CPU works, is
elegant only for a very restricted set of tasks), however FP
features are coming to FPC as well, for example FPC trunk supports
anonymous functions.<br>
<blockquote type="cite"
cite="mid:f52edf18-ffd5-4304-8c63-26cdcabba4a5@ciberpiula.net">
<ul>
</ul>
<p>And all those languages are backed by big corporations.</p>
<p>Lazarus is for Delphi nostalgic guys, like me. I'm sure 90% of
Lazarus users have worked professionally with Delphi before.<br>
</p>
</blockquote>
<p>Not me. I really think Free Pascal is an improvement over many
"modern" languages. When I say some of the issues are not "quality
of life" issues for me, means that I would never trade things like
10 times faster compilation speed or the runtime speed for
something like tuples or having the ability to declare vars
everywhere.<br>
</p>
<p>Nikolay<br>
</p>
</body>
</html>