Author Topic: Why do you care that much about BASIC part in the name of a language?  (Read 3996 times)

n00b

  • Newcomer
  • *
  • Posts: 44
    • View Profile
And yes - combining BASIC with pure WinAPI is like embedding Assembler in Scratch code. Insane. ;)

I do that all the time, and have done so the last 25+ years. Why should that be insane? It's easy, and often the most elegant way to do things.

Lol, it looks like you said you combine assembler with scratch. Now that would be interesting.  :D

John

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
BASIC and other interpretive/scripting languages are focused on getting various tasks completed quickly and without a lot of coding. No one uses BASIC to develop commercial Windows applications. Calling specific libraries like cURL, SQLite, ODBC from an interpretive environment is the only sane way of interfacing with OS resources. Calling OS specific API functions from these languages is nuts.

Richey

  • Full Member
  • ***
  • Posts: 132
    • View Profile
That's why probably no one ever wrote anything about DiscoRunner (http://discorunner.com/) here.

Not here, but the author(s) actually posted details on BP.org

jj2007

  • Full Member
  • ***
  • Posts: 111
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
Lol, it looks like you said you combine assembler with scratch. Now that would be interesting.  :D

Right ;-)

But I meant, of course, combinining Basic with WinAPI. Simple example:
Code: [Select]
GuiParas equ "Hello, I am a full-fledged Windows application"
GuiMenu equ @File, &Open, &Save, -, E&xit, @Edit, Undo, Copy, Paste
include \masm32\MasmBasic\Res\MbGui.asm
Event Menu
      invoke MessageBox, 0, Str$("This is item #%i", MenuID), Chr$("Menu was clicked:"), MB_OK
GuiEnd

Just in case you don't spot it: MessageBox is a low level Windows API function 8)
« Last Edit: 27. August 2016, 10:34:45 by jj2007 »

Tomaaz

  • Guest
But I meant, of course, combinining Basic with WinAPI. Simple example:
Code: [Select]
GuiParas equ "Hello, I am a full-fledged Windows application"
GuiMenu equ @File, &Open, &Save, -, E&xit, @Edit, Undo, Copy, Paste
include \masm32\MasmBasic\Res\MbGui.asm
Event Menu
      invoke MessageBox, 0, Str$("This is item #%i", MenuID), Chr$("Menu was clicked:"), MB_OK
GuiEnd

Just in case you don't spot it: MessageBox is a low level Windows API function 8)

Somehow, I'm not convinced. Your example doesn't look either BASIC-like or elegant to me. Also, it seems to be more complex than displaying a simple message, but the only one low level function you're using is the one that is the easiest to use. But I don't want to argue about it anymore, as it's something different than what I wanted to discuss in this topic.

EDIT OK, I'm a bit curious, so could you show me an example of, let's say, downloading a file from the internet and saving it to the hard disk that uses only/mostly WinAPI low level functions?
« Last Edit: 27. August 2016, 11:30:37 by Tomaaz »

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 571
    • View Profile
    • Home of EGSL
That's why probably no one ever wrote anything about DiscoRunner (http://discorunner.com/) here.

Not here, but the author(s) actually posted details on BP.org
Oh, I didn't remember.
Best regards,
Cybermonkey

Tomaaz

  • Guest
Not here, but the author(s) actually posted details on BP.org

And most likely was totally ignored. That's why

Oh, I didn't remember.

I don't recall it, either. Well, the author should have used "BASIC" when naming his interpreter. That would have gained him much more attention on BP.org and here. ;)

Aurel

  • Regular Member
  • Sr. Member
  • *
  • Posts: 258
    • View Profile
First ...
Pure Basic have set of wrapper functions to work on winApi on windows
is that clear to you?
Linux version have also set of wrapper functions to work with GTK libs.

Quote
I do that all the time, and have done so the last 25+ years. Why should that be insane? It's easy, and often the most elegant way to do things.
EXACTLY  ;)
..and many other have such a wrappers but also you can call any native
winApi functions
Power Basic
Pure Basic
Free Basic
Emargence Basic (IWB)
Creative Basic
Mini Basic
Thin basic
FBSL
DLib
Blitz Basic
etc..etc..etc

Richey

  • Full Member
  • ***
  • Posts: 132
    • View Profile
Not here, but the author(s) actually posted details on BP.org

And most likely was totally ignored. That's why

Oh, I didn't remember.

I don't recall it, either. Well, the author should have used "BASIC" when naming his interpreter. That would have gained him much more attention on BP.org and here. ;)

Nope. There was a discussion. Dunny and the author discussed some of the similarities between their respective projects.

Tomaaz

  • Guest
First ...
Pure Basic have set of wrapper functions to work on winApi on windows
is that clear to you?
Linux version have also set of wrapper functions to work with GTK libs.

Why do you ask me this question? Did you read my posts at all? For example, this part?

Isn't it that PureBasic adds another layer which interacts with low level elements both on Windows and Linux (perhaps, slightly different in each case)?

Or this one, maybe?

Were you talking about the WinAPI that is focused mainly on C or were you talking about wrapper libraries (I think John was talking about the WinAPI)? Do you know that IUP supports calling native WinAPI

Unless you start reading my posts, this conversation doesn't make any sense.

Tomaaz

  • Guest
Nope. There was a discussion. Dunny and the author discussed some of the similarities between their respective projects.

I was wrong then. ;) But I had several breaks from using BP.org. ;)

Aurel

  • Regular Member
  • Sr. Member
  • *
  • Posts: 258
    • View Profile
Quote
Unless you start reading my posts, this conversation doesn't make any sense.
i can say same to you.

Tomaaz

  • Guest
]
i can say same to you.

Considering the fact that I posted and asked you some questions first, you can't. Sorry.

jj2007

  • Full Member
  • ***
  • Posts: 111
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
OK, I'm a bit curious, so could you show me an example of, let's say, downloading a file from the internet and saving it to the hard disk that uses only/mostly WinAPI low level functions?

Here is an example that uses low level WinAPI functions only:
Code: [Select]
GuiParas equ "Hello, I am a full-fledged Windows application"
GuiMenu equ @File, &Download, &Open, &Save, -, E&xit, @Edit, Undo, Copy, Paste
include \masm32\MasmBasic\Res\MbGui.asm
Event Menu
  .if MenuID==0
Let esi=FileRead$("http://retrogamecoding.org/board/index.php")
invoke MessageBox, 0, NoTag$(esi), Chr$("You clicked 'Download':"), MB_OK
  .else
invoke MessageBox, 0, Str$("This is item #%i", MenuID), Chr$("Menu was clicked:"), MB_OK
  .endif
GuiEnd

Exe & source attached. I have a suspicion, though, that you meant an example that shows all the WinAPI functions that are being used under the hood... and here we are back to the question: Would that be BASIC?

The Windows API has over 20,000 functions. BASIC should have about 100 commands. You can have both 100 simple basic commands and a huge default library in peaceful coexistence.
« Last Edit: 27. August 2016, 17:51:12 by jj2007 »

Tomaaz

  • Guest
The Windows API has over 20,000 functions. BASIC should have about 100 commands. You can have both 100 simple basic commands and a huge default library in peaceful coexistence.

That's the whole point. Using these 20,000 functions directly from BASIC would be insane. So, the question is - is it better to go for specific wrappers written for particular BASIC dialects or go for something like IUP, which in fact, to some extent, is probably a WinAPI wrapper? As far as I understand it, it's not possible to program on Windows without calling WinAPI, so why can it be IUP that does it? For me using WinAPI means calling its function directly and not via special wrappers (how would be it different from calling it from IUP?). Things like IUP are ready to use, well tested, multi-platform, they support many languages... I can understand IUP vs pure WinAPI discussion. But IUP versus wrappers? I don't really know what is that Aurel wants to prove. That IUP is crap? I'm pretty sure it interacts with WinAPI at some point, so? Maybe someone else can explain it to me... I'm serious. I'm always happy to learn new things.