Recent

Author Topic: Interesting article about AI  (Read 12976 times)

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1274
Re: Interesting article about AI
« Reply #90 on: December 12, 2024, 04:22:43 pm »
Joanna is easy to compare Procedural with OOP.

Basically the main difference is where the data and the methods are. In OOP all are together, in Procedural are separated.

That's all, no more differences.

For that you can create the same code with both.

Operating systems are made with C and procedural, if an entire operating system is made with that, imagine...
  of course but for the code I use oop is so much more elegant For keeping stuff organized. I once had a program with thousands of lines of disconnected variables and methods. Oop gives good control over data access.
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

lainz

  • Hero Member
  • *****
  • Posts: 4659
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Interesting article about AI
« Reply #91 on: December 12, 2024, 04:40:25 pm »
For that my example uses advanced records.

Is like is done in Rust language for example.

The same with a bit of sugar, not that much like in OOP but just a bit, and faster.

I don't have problems using OOP...

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1274
Re: Interesting article about AI
« Reply #92 on: December 12, 2024, 04:52:17 pm »
Why use advanced records instead of classes? Is it just for the automatic initialization?
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

lainz

  • Hero Member
  • *****
  • Posts: 4659
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Interesting article about AI
« Reply #93 on: December 12, 2024, 06:03:06 pm »
Why use advanced records instead of classes? Is it just for the automatic initialization?

Is a thing I don't fully understand, but about memory. Maybe 440bx can enlighten us.

Something like less memory usage, less memory in the heap or something like that... that produces less bugs...

440bx

  • Hero Member
  • *****
  • Posts: 4891
Re: Interesting article about AI
« Reply #94 on: December 12, 2024, 06:58:51 pm »
Why use advanced records instead of classes? Is it just for the automatic initialization?
There is no automatic initialization in advanced records anymore than there is in a plain record.  IOW, if you don't initialize it, it's not initialized.

A couple of reasons to use advanced records instead of classes: 1. Unlike classes advanced records can be on the stack (or anywhere the programmer chooses to place them)  2. They cannot inherit nor be inherited from, everything you need to know about it is right there in the record, IOW, you don't have to peel the inheritance onion to see its parts.

Someone who makes so many claims about OOP should know this stuff.  Advanced records are the seed of OOP, add inheritance and polymorphism to them while restricting them to be on the heap and you have classes.  Without that restriction, you have the old objects.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5811
  • Compiler Developer
Re: Interesting article about AI
« Reply #95 on: December 12, 2024, 09:46:33 pm »
Why use advanced records instead of classes? Is it just for the automatic initialization?

In addition to what 440bx mentioned: they can have operator overloads inside them which in turn are usable by generics. Which is not the case if you have a global operator overload for the same type.

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1274
Re: Interesting article about AI
« Reply #96 on: December 12, 2024, 11:59:01 pm »
Thanks pascaldragon.

440bx I’d like to see your code but there only seems to be a download link. Is it not shown in forums? I should not have to download an entire project to see some code.

It seems like advanced records are for delphi compatibility. They have no inheritance or virtual methods.

What claims did I make about oop?  That it works great for what I do? Yes it does  8-)
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

440bx

  • Hero Member
  • *****
  • Posts: 4891
Re: Interesting article about AI
« Reply #97 on: December 13, 2024, 02:55:33 am »
440bx I’d like to see your code but there only seems to be a download link. Is it not shown in forums? I should not have to download an entire project to see some code.
If all you want is to see the code, download ZydisE.7z which is attached to the post https://forum.lazarus.freepascal.org/index.php/topic,67665.msg521432.html#msg521432

If you want to compile (and possibly run/debug) some of the examples then you'll need all the archives.  Follow the instructions found at the above link.

They have no inheritance or virtual methods.
That's precisely why they exist.  Inheritance and polymorphism aren't always necessary (even in OOP and you should know that.)

(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 576
Re: Interesting article about AI
« Reply #98 on: December 13, 2024, 04:49:18 am »
A couple of reasons to use advanced records instead of classes: 1. Unlike classes advanced records can be on the stack (or anywhere the programmer chooses to place them)  2. They cannot inherit nor be inherited from, everything you need to know about it is right there in the record, IOW, you don't have to peel the inheritance onion to see its parts.

Second that, especially 2.  And that matters if you tend not to document your work very well but want to code for a future reader.

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1274
Re: Interesting article about AI
« Reply #99 on: December 13, 2024, 10:56:25 am »
440bx I’d like to see your code but there only seems to be a download link. Is it not shown in forums? I should not have to download an entire project to see some code.
If all you want is to see the code, download ZydisE.7z which is attached to the post https://forum.lazarus.freepascal.org/index.php/topic,67665.msg521432.html#msg521432

If you want to compile (and possibly run/debug) some of the examples then you'll need all the archives.  Follow the instructions found at the above link.

They have no inheritance or virtual methods.
That's precisely why they exist.  Inheritance and polymorphism aren't always necessary (even in OOP and you should know that.)
440bx I’m not sure how to explain this to you but I’m not on a computer that can run your code at the moment. Which is why I keep asking you If I can have a look at some of your code in the code window in forum but apparently that is not going to happen.
All I know about it is that it’s a disassembler and it looks like a console program ? I know absolutely nothing about disassemblers which is why I’m curious to see your code.
A couple of reasons to use advanced records instead of classes: 1. Unlike classes advanced records can be on the stack (or anywhere the programmer chooses to place them)  2. They cannot inherit nor be inherited from, everything you need to know about it is right there in the record, IOW, you don't have to peel the inheritance onion to see its parts.
Second that, especially 2.  And that matters if you tend not to document your work very well but want to code for a future reader.
Obviously inheritance and polymorphism are not necessary for simple things. I started of with very simple things and practiced for long time to get to current skill level.
 Peel inheritance onion  :D that makes it sound so easy... my inheritance hierarchy is scattered across several files so mine is more like a inheritance scavenger hunt  8) No matter how well I document code it is never enough to remember what I did after a long time.
« Last Edit: December 13, 2024, 11:00:24 am by Joanna from IRC »
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

440bx

  • Hero Member
  • *****
  • Posts: 4891
Re: Interesting article about AI
« Reply #100 on: December 13, 2024, 01:14:25 pm »
440bx I’m not sure how to explain this to you but I’m not on a computer that can run your code at the moment.
You should have mentioned that before.  Is this situation permanent or temporary ?  either way you can still look at the code by downloading the archive I mentioned previously.

All I know about it is that it’s a disassembler and it looks like a console program ? I know absolutely nothing about disassemblers which is why I’m curious to see your code.
ZydisInfoC  is a GUI program and there is a screenshot of it in the thread I linked to.  Here is the link again:
https://forum.lazarus.freepascal.org/index.php/topic,67665.msg521439.html#msg521439
and here is a partial quote of the text found there:
Quote
The "C" version is a GUI version that takes as input a PE file (by means of drag and drop.) It uses very _basic_ tests to attempt to separate code from data (with varying success depending on the PE file.)
It has a number of interesting features, among them: nice shell icons drag and drop, GUI and PE analysis threads independent of each other and not requiring synchronization objects of any kind, mouse wheel support, multi-monitor recognition (app always starts in the monitor where the cursor is), filtering of binary instructions by uniqueness or not being optimized (as deemed by Zydis, double click the client area to switch indexes), drag the window from the client area (no need to go to the caption), flicker free (because of double buffering.)
Reasonably fast, analyzes an older 32 bit version of Lazarus (214MB) in about 8 seconds.

As the quoted text states, it has  a number of interesting features in addition to showing what Zydis can do _and_ there is screenshot of it attached to the post.

<snip> my inheritance hierarchy is scattered across several files so mine is more like a inheritance scavenger hunt  8) No matter how well I document code it is never enough to remember what I did after a long time.
Typical of what I consider poorly designed code.  Have a look at the mainline of ZydisInhoC (ZydisInhoC.lpr) and that's not even as well structured as a program I intend to use regularly but it's "decent".  It's actually a proof-of-concept program for something else I'm developing, IOW, it's not a program I use regularly, actually I rarely use it.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

VisualLab

  • Hero Member
  • *****
  • Posts: 614
Re: Interesting article about AI
« Reply #101 on: December 13, 2024, 09:28:26 pm »
The only good OOP code is the OOP code that remains unwritten.  That's the OOP code that's really good. :)

I will not engage in a discussion about OOP but, I will re-state what I've already said too often: procedural programming can _always_ produce greater quality code than OOP. 

Whoever makes categorical statements must prove his point if he wants others to agree with him. So I won't enter into the discussion about OOP, but I will repeat what I have said too often: "how can procedural programming _always_ produce better quality code than OOP"? I'm asking for proof. It can be direct or indirect, it can be inductive or combinatorial or experimental in a laboratory. It doesn't matter. As long as proof is presented.

OOP is a religion.  People just want to believe in it, facts and logic are absent in that realm.

The lack of proof will mean that all this talk like "OOP is a religion" is just blabbering nonsense and has nothing to do with facts and logic.

So we, "procedurally-structurally unaware" and "ideologically-religiously blinded in OOP", are waiting for the "thesis" about the superiority of Proc-Struct over OOP to be proven.



...the thing I fear most is a monoculture filled with a bunch of miserable fake choices and irrelevant hype. Kind of like going into a grocery store and there being 20 types of cooked orange juice and no chance of finding fresh orange juice.

For example, for decades in IT, it was a C/C++ monoculture. For some, it was an industry standard, and for others, a monoculture. When standards are abused, they become monocultures. This would not be so burdensome perhaps if the most painful deficiencies and shortcomings of both languages had been removed. However, this did not happen.

Now, for some time now, the Python-JavaScript monoculture has been nesting.



The "private", "protected", etc are just crutches needed by OOP to accomplish what decently designed code accomplishes automatically.

How does he achieve this? Proof please. Otherwise it's just bullshit.

Just like the convention to prefix fields with "F" is a poor idea to mitigate bad design inherent in OOP code and data structures.

It's just a convention in naming identifiers. In procedural-structured programming it's also useful and used.



440bx that Explanation is a bit vague. I know nothing about your code and it would be just as counterproductive for me to ask you how to rewrite all the Lazarus lcl libraries without oop.  :D
I want to learn more about how you survive without using oop purely out of curiosity.
As a well known programmer says "talk is cheap, show me the code"...

Is it really a good idea to refer to THIS programmer's statements? :) He has often mixed sensible statements with complete nonsense. In addition, he has an obsession with the abuse of “historical-museum solutions” in the IT industry :D



This is getting off topic, it was about AI, now about programming paradigms...

Not the first time :) Maybe it's because the topic is too general (and broad).



I have a number of problems with A.I, among them:

1. It has no problem solving ability whatsoever.
2. It is unable to evaluate the correctness of the "solutions" it offers.
3. It seems to be little more than a plagiarism engine which, at least in some cases, could have some undesirable legal implications and it does not seem to ever credit the original authors (which, at least  by some standards, is unethical.)
4. the financial interests peddling A.I rarely, if ever, disclose the above problems....

I think so too. These are very serious flaws in current AI solutions.

...On the contrary, they seem to purposely ignore/cover them up (they have that in common with some OOP proponents.)

That what are the so-called "OOP advocates" hiding? That they are reptilians? :) And they "shove OOP down the throats" of poor procedural-structural programmers :D



One of the saddest side effects of A.I is that it seems to have somewhat (mostly?) replaced expert systems.

Unlike A.I, well implemented expert systems could not only provide an answer but fully justify the answer by exposing the decision tree that lead to it.  Also, a good expert system can learn _but_ its newly acquired knowledge must normally be reviewed and validated by human experts before it can become part of the internal decision tree.

Also, a well implemented expert system could say "I don't know" and show the undecidable points in the decision tree.

A.I does not seem to have any guard rails of any kind. That is not a good thing.

I agree with that. I guess we have to wait until current AI solutions hit the wall, as was the case with previous "AI waves". Then all this harmful hype will die down. And programmers will go back to writing utility and engineering software. Because:

To develop, setup and maintain a serious expert system there is need to invest in knowledge and time.

And the despots currently managing the largest IT companies do not feel like creating useful solutions (concrete tools). They prefer the vague promises of programmers-magicians. Maybe because these despots "don't have knowledge" of the field in which their companies operate.



@TRon, I understand your concern. However, there is no reason to suspect all scientific groups working in this area of dishonesty or a willingness to profit at any cost.

This is not about suspecting pure dishonesty (as sometimes happens in the case of "scrounging up" money for useless junk). This is more about people involved in AI promising (to others and themselves) something that does not exist yet. They hope that they are close to the solution and will soon achieve it. So they are also deceiving themselves. It's more of a type of naivety that leads to unintentional deception. It is a bit like the case of biochemists looking for a cure for cancer, who study various plants and fungi in the hope that they are already close to the final solution. Meanwhile, each subsequent step shows that the problem being studied is much more complicated than it seemed before.



I doubt it. Oop doesn’t work well with copy paste programmers it’s too complicated.
In OOP the copy/paste method "graduated" to inheritance which is one of the reasons OOP programs are much bigger than a reasonably well designed pure procedural program.

Such a statement rather shows a lack of knowledge about how inheritance in OOP is implemented (at least in Object Pascal). There is no "copy/paste" here. So Joanna is right.

One of the similarities between A.I and OOP, is the extensive use of "prefabricated" blocks glued together.  Initial productivity is higher but the quality is _much_ lower.  Like a prefab house.

Prefabrication is used in many areas. What is important is the internal details of this prefabrication. Because, as the saying goes, "the devil is in the details.". Not only in AI and OOP. Also outside of IT. And are all AI libraries written as OOP? Or maybe some (or even most) of them are written in C and Fortan?

You criticize A.I as I do but, unlike me, you refuse to see that the reason(s) A.I is being used are much the same as the reason OOP has become popular.  It allows people often with limited knowledge to feel more productive, very often at the expense of the final product's quality.

Using libraries that use only procedures and structures (e.g. WinAPI, libc, LAPACK, etc.) "allows people with limited knowledge to feel more productive, very often at the expense of the quality of the final product.". That's why programs should be written only in assembler, written only by yourself :D



Procedural programming like in C is possible to do all kind of programs. Everything so I agree with 440bx.

Objects are just sugar, but I must admit I use objects because I'm used to do that way, but that doesn't mean that Procedural programming can't do anything I do with objects.

Assembly programming allows you to do all kinds of programs. Everything, so I disagree with... Procedures and structures are just sugar, but I have to admit that I use procedures and structures because I'm used to it, but that doesn't mean that assembly programming can't do anything that I do with procedures and structures. :D



They have no inheritance or virtual methods.
That's precisely why they exist.  Inheritance and polymorphism aren't always necessary...

Yes. As in every case, you should not overuse certain solutions. Unfortunately, people overuse them because they either do not understand everything or they do it deliberately. For example, they write a program as a collection of several thousand procedures and several thousand structures. And they could write it as a collection of several ten classes. But no, because OOP is evil incarnate. And then the forums "burst at the seams" with questions about how to use these procedures and in what order to call them.

ackarwow

  • Full Member
  • ***
  • Posts: 127
    • Andrzej Karwowski's Homepage
Re: Interesting article about AI
« Reply #102 on: December 13, 2024, 10:03:38 pm »
(...)
"how can procedural programming _always_ produce better quality code than OOP"? I'm asking for proof.
(...)
Maybe it's about programming convenience? If so - it's related to needs (what do I need it for?), habits and tastes (how I like and can write?). Of course, the discussion still makes sense, but a resolution is impossible.

440bx

  • Hero Member
  • *****
  • Posts: 4891
Re: Interesting article about AI
« Reply #103 on: December 13, 2024, 10:49:08 pm »
I'm asking for proof. It can be direct or indirect, it can be inductive or combinatorial or experimental in a laboratory. It doesn't matter. As long as proof is presented.
Great !! ask and you shall get.  My only concern is that is off topic in this thread.  I invite you to create a new thread for that purpose.

Also, so that you are not caught by surprise, the way I intend to prove it is by comparing parts of the code of ZydisInfoC to whatever OOP version, you or anyone else can produce that is at least as easy to understand and maintain while not using significantly more resources.   

IOW, I present non-OOP code that I've already written and challenge you or anyone else who cares to participate to either do as well or better with OOP.

I state that neither you nor anyone else will be able to produce a result of similar quality using OOP.

For the record, ZydisInfoC is just POC code.  I could improve it quite a bit but I submit it as-is with complete confidence it will not be matched using OOP.

OOP is a religion.  People just want to believe in it, facts and logic are absent in that realm.
I fully stand by what I said.

The lack of proof will mean that all this talk like "OOP is a religion" is just blabbering nonsense and has nothing to do with facts and logic.
I like a proof-man, now prove me wrong.  Show me an OOP version of ZydisInfoC that improves upon it.

Otherwise, you're just preaching what you believe while failing to provide a foundation for it.

"
The "private", "protected", etc are just crutches needed by OOP to accomplish what decently designed code accomplishes automatically.

How does he achieve this? Proof please. Otherwise it's just bullshit.
You're the OOP man.  Show me how you use use that stuff to improve upon my code.


It's just a convention in naming identifiers. In procedural-structured programming it's also useful and used.
I might have missed it but, I've never seen non-OOP code _blanket_ prefix local variables with "F".  Prove me wrong, link to an example of non-OOP code, created more than 2 years ago, that uses that.

As a well known programmer says "talk is cheap, show me the code"...

Is it really a good idea to refer to THIS programmer's statements? :)
Yes, it's good idea because he's got a point.

Now, I'm going to paraphrase you and him:  The proof is in the code.

I've seen all your criticism, now show me the code/proof.

...On the contrary, they seem to purposely ignore/cover them up (they have that in common with some OOP proponents.)

That what are the so-called "OOP advocates" hiding? That they are reptilians? :) And they "shove OOP down the throats" of poor procedural-structural programmers :D
What some (I should say "many" but I'm going to be kind) OOP proponents work really hard at sweeping under the rug is the loss of quality due to OOP.  That loss is evident in the larger executable size, higher use of resources (memory, CPU and O/S related) but not only it is often conveniently ignored but sometimes even denied.  Not to mention code that is much harder to maintain due to the gross abuse of polymorphism and exceptions.  OOP really is like religion, if you ignore all its problems then it's great.  Hallelujah or it alleluia ? if Sender is Hallelujah then ...


In OOP the copy/paste method "graduated" to inheritance which is one of the reasons OOP programs are much bigger than a reasonably well designed pure procedural program.

Such a statement rather shows a lack of knowledge about how inheritance in OOP is implemented (at least in Object Pascal). There is no "copy/paste" here. So Joanna is right.
Sorry... nope, you and Joanna are both wrong.  I didn't state there was copy/paste going on, I said there is inheritance going on which can be a lot worse than simple copy/paste.

Using libraries that use only procedures and structures (e.g. WinAPI, libc, LAPACK, etc.) "allows people with limited knowledge to feel more productive, very often at the expense of the quality of the final product.". That's why programs should be written only in assembler, written only by yourself :D
with that and the Assembly comment you got your "need to get silly" fix out of the way :)



Start a new thread,  show me I'm wrong about OOP. :)

As the well known programmer said: talk is cheap, show me the code.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Joanna from IRC

  • Hero Member
  • *****
  • Posts: 1274
Re: Interesting article about AI
« Reply #104 on: December 13, 2024, 11:40:54 pm »
Visual lab thanks for your thorough reply.
The part of having a huge program with many Disconnected procedures functions and records was what I had before I discovered oop and no way am I ever going back to that mess.

440bx I never said that oop is needed for every possible type of program. It depends upon what the program is. Oop is needed by my program. I have files filled with things with same ancestor and I don’t like excessively long files so I’m going to arrange it how I like without your advice.

I have asked you many times to show us some of your code here so that we can look at it together. I’m not going to go download something and rewrite it for you in oop. That’s not proof of anything. Yes I can understand if you tried to make it in oop and your frustrated and angry and now hate oop and everyone who uses it. This is very childish behavior.

Just show us a file of your project. We can’t give you any advice on code we cannot look at. Not everything is suitable for oop. According to your logic something must always be useful on all occasions otherwise it’s worthless. By your logic, life sustaining raincoats should never be used because You tried wearing one on a hot day...  ::)

You have REFUSED to engage me in hypothetical problem solving exercises like making a cake or building a house where you could have demonstrated the superiority of your non oop approach. It always comes back to demands that we download and rewrite your program for you... if you want help just show the code here where we can see it!
« Last Edit: December 14, 2024, 12:03:53 am by Joanna from IRC »
✨ 🙋🏻‍♀️ More Pascal enthusiasts are needed on IRC .. https://libera.chat/guides/ IRC.LIBERA.CHAT  Ports [6667 plaintext ] or [6697 secure] channel #fpc  #pascal Please private Message me if you have any questions or need assistance. 💁🏻‍♀️

 

TinyPortal © 2005-2018