Discussions
#1
Please use this thread for asking all kinds of questions!
Reply
#2
Everything has a learning curve, and this won´t be different with my IDE (for new users) and JKB. So please be sure to have read and understand the first three treads in this subforum ("Download and setup", "What is different" and "How to run own code).

If the information provided is not enough, feel free to ask!

Please report errors, problems, crashes, whatever doesn´t work as expected. I need your sources of course (at least a boiled down version demonstrating the problem, with a sufficient description of your problem. I must be able to reproduce your problem in order to solve it.

Have fun

JK
Reply
#3
No Dale,

the link always remains the same, but i uploaded a new version of "update.zip", which contains updated files. 

Could you get it running, or do you still experience problems (except for the fact, that some things are new)?
Reply
#4
Hi Juergen,

I have yet to install the entire package and spend time with it when I have spare time but I have already one question.

Do we have access to the generated assembler source? I think this could be an very valuable way to learn about assembly language then. 

Kind regards,
Steven
Reply
#5
Yes, you will find a file named <sourec file name>.asm in the same folder. 

I don´t know, if this could be taken as a reference for "well written" assembler code, because there (for several reasons) is still potential for optimizing. And you won´t be able to se all code, most keyword functionality happens in an already assembled run-time library (rtl.lib) which is only linked in by the linker. The way i did certain things is one way of doing it. As always there are many ways to skin a cat - maybe better ones than mine.
Reply
#6
Looks like you have an impressive start on a new Basic compiler. The main thing being dynamic Strings and WStrings, which for some reason others lack. Free Basic does have a dynamic String.
But is it a good idea to target it as a PB replacement? It will have to be almost 100% compatible to compile existing PB code. By the time you get there, how many will care? A potential new user won’t.
If the target is a new Basic compiler, there is no need to support 32bit, few will care.
Then you don’t have arbitrary data types to deal with.
The modern trend is something like U8, I64, F64; you know exactly what it is.
If you wish to support COM, supporting it in the compiler makes the assembly very complex. As a library, it can be added later.
Trying to support OPP and inheritance makes a confusing mess of the syntax. Some new compilers such as Go and Zig moved away from it. An object is just an allocated UDT.
Inheritance is just adding another UDT in the UDT and using the added UDT to call its procedures.

One really nice thing about Free Basic, ability to add a constructor and destructor to the UDT is powerful. With that, almost everything including strings and arrays can be in libraries. The destructor frees the memory when it goes out of scope.
Shouldn’t you focus on the compiler first, then the editor? The editor may have to keep changing if the compiler does.
If I was writing a compiler, I’d make it case sensitive to get away from reserved word hell.

Forget about the past, make a Basic compiler for the future. Just core necessities in the compiler, everything else in libraries which can be built and replaced over time as need arises.
Also, you need a ReAlloc function.
Good luck. Be interesting to see what you come up with.
Stan…
Reply
#7
Hi Stanley,

thanks for your post. I have seen some very advanced code you posted and i really appreciate that!.

But in this case i must say you misunderstood a few things. 

What makes you think STRING and WSTRING are not supported? I support ASCIIZ, WSTRINGZ, STRING and WSTRING, i don´t support fixed length strings like ... as STRING * x and ... WSTRING * x, i support U8, I64, F64 as well.

There is a lot of working PowerBASIC code out there, so having a compiler, which can compile this code without a major re-write, makes sense to me. 64 bit code, as you know, is a bit different and requires adjustments. So why not make existing 32 bit work again and then port it to 64 bit (without too much effort)? My work can do 64 bit!

FreeBASIC has it´s own (dynamic) string implementation, which cannot be used for COM. COM needs OLE-strings (like PB´s and mine). You can do COM in FreeBASIC though. I tried FreeBASIC myself, i even contributed a little bit to integrate (dynamic) WSTRINGs (mostly José´s work) and some other minor things. What drove me crazy about FreeBASIC was type casting and variable type hell (just like in C - typedef has it´s pros and cons).

Quote:An object is just an allocated UDT.
Inheritance is just adding another UDT in the UDT and using the added UDT to call its procedures.

I know, but i didn´t write code for inheritance yet.


Having a constructor and destructor (like in FreeBASIC and C and ...) may be nice, but nothing prevents you from coding it yourself. You would have to write code for a constructor and destructor anyway, if needed. So where is the major difference?

My IDE has been there for years, so why not use it for something new? Especially because it makes it easier for me (compared to any third party tool) to debug and control what´s going on 


Quote:Also, you need a ReAlloc function.

??? what for ?  

Sorry, to me it seems you had a very quick read of my posts without even downloading or trying it. I accept all kinds of substantiated critic, but please don´t judge on a quick look!
Reply
#8
I guess I didn’t write that very well.
I know you have dynamic Strings and WStrings, that’s what impressed me.
Yes, I did try it out, great job.
Looking forward to seeing what you come up with.
Reply
#9
Thanks Stanley,

again i appreciate your post.

"Making a mistake and not correcting it, that's called a mistake." (Konfuzius)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)