Any wheels that need to be redesigned?

I know some of these words.

Network Clock Distribution Protocols?

No-code development program. Some people know them as programs used for writing other programs (or code). :wink:

Redesign software and export to chosen PL (i.e C++, etc).

Don’t initially focus on building a mousetrap by its individual parts versus the mouse you’re capturing. You might discover the mouse is a possum…

1 Like

Alright! I started writing a reduced code graphical editor using wxFrameBuilder at one point. Maybe I could restart development on that for native Haiku! The plan was to use an XML syntax for text-based version control like Git and locale support to limit the English dependencies of menu items and requesters.

One problem I ran into with my design was that modal requesters tended to spawn additional modal requesters until you had many layers of requesters open at the same time. I don’t think I can stack-and-tile my way out of that one. Maybe there’s a way to make them share a window.

I’ll start another thread on that one.

1 Like

C might be the default but you can also set it to generate C++. The Wikipedia page on so-called source to source compilers includes a table that shows Nim amongst only a few that output this language, although I suspect the list is not exhaustive.

re:Visual Code Editor

After looking at the syntax of D, it seems to more closely match what I was looking for with my graphical language. First things first. Let me look at the D runtimes.

2 Likes

D looks very nice. Unfortunatly it only has managed memory AFAIK.

From what I gathered, your transpiler generates C++ source files for GCC/LLVM compilation.

  • C++ Supportable:
    • C++98 (BeOS R5, optional)
    • C++11 (default)

Goals:

  • WxFormBuilder-like visual code editor
    • Convert YABASIC 2.90-compat source files to C++11.
    • XML sytax for text-based version control
    • International language support (English, default)

Correct as needed.

Now application developers can develop native Haiku applications and device drivers in YABASIC and get C++ performance - without knowing C++… :wink:

Many years ago, I saw certain very high-level ‘rapid’ application development programs that basically used pseudocode (like XML) for project development and could import/export C/C++ files.

Sidenote:
As for the structured BASIC programming discussion, Pascal was force fed on many pupils learning data structures and database programming. You’d get the Pascal compiler for academia settings. In comparison, BASIC implementations in academia were almost never with the BASIC compiler component (usually only in the certain well-funded schools and some colleges/universities). Home computers usually never had BASIC compilers included due to extra license costs. Historically, most distributors provided cut-down versions or variants of their BASIC implementation (so you’d buy the compiler and/or a full-featured version (kinda, might miss the matrix support and other things)). Those were the days of the $500 smart typewriters…

So academia taught from the BASIC->PASCAL model. Modula-2 wasn’t as popular in most academia circles (funding and training costs). College/university and scientific work-wise, you’d get on-the-job trained and access to the VAX-11/Cray/other machines using C (or you’d learn those ‘business’ and ‘report generation’ programming languages). C++ didn’t exist or was still in its compiler implementation infancy so not heavily used or taught back then for any cross-platform kernel/app development.

1 Like

And maybe support for newer C++ versions?

I find it hard to think of “academia” as a single body in this case. It’s like saying “industry” picked one single language. If we take the 90s that wasn’t the case at all for industry: UNIX had C, BeOS had C++, NeXT had objective-C, and MacOS had a bit of everything but maybe a bit more Pascal. And then each app could possibly be written in a different language.

Likewise in academia, and in previous times too. One of my teachers had learnt and used Simula-67 (one of the first object oriented languages, and the one that defined the object model used in C++ 20 years later), and that was one of the many options. Likewise Pascal is just one of the many derivatives of the ALGOL family (in fact, it is a kind of fork of ALGOL after failing to get enhancements included in the original). And besides the ALGOL school (which is where a lot of modern languages indirectly draw inspiration from) there are also COBOL and FORTRAN and Lisp.

ALGOL is also notable for inventing the “design by committee” method, and specifying a language so complex that no one would actually implement it for several years. Several people hated it and the committee specifying it had a part publishing a “minority report” explaining how bad they thought the language was. Yet, it was an inspiration for both Pascal and C, and then, these two were an inspiration for a lot of modern languages.

1 Like
  • C++ Manual:

    • ISO/IEC 14882:2020 (Edition 6, 2020-12)
  • GCC 11.2.0:

    • C++17 (GNU++17, default)
    • C++20
    • C++23
  • LLVM 16.0.5:

    • C++17 (GNU++17, default)
    • C++20
    • C++23

You’re mixing the capabilities of separate but potentially intertwined projects. The YAB2C++ transpiler could be recoded as a 2-pass translator to XML, the XML transpiler/exporter could target D or C++ (separate transpilers), the GUI based editor and all the necessary locales for that (plus a few extras).

The extra locales mentioned above can replace technical jargon with more descriptive terminology. A loop repeats code so the simplified version could call it a repeater instead, for example. The goal is to lower the barrier to entering the art of programming.

I remember only an XML wrapper for Java. Were they open source? I can check my bookmarks too.

edit:

Was it http://www.o-xml.org/ by chance?

Please reply on the “XML Code format” thread

Looks like your sidenote pretty much describes the situation in my school days. I remember our modula 2 compiler had many faults for instance which for me meant I only used it minimally. Also I remember a VAX PDP 11 mainframe with discrete CPU’s in it that was never able to fully boot anymore. But I loved how they were able to build a computer that way with all these low integrated circuits, transistors and magnetic core memory…

We also did Motorola assembly along with a very detailed description in lessons of how that CPU was designed. After a year when I finally grasped the thing it became my first love… (6802, later on 6809 and a bit 68000)

Sorry for the sidenote extension in the thread… :wink:

2 Likes

Wrap Up

In order to break this up into separate threads for their respective parts, I think this thread should be spun down. After I’ve started the other threads, I’ll reserve this thread for other rants related to the original topic.

Thanks to all of you for civilized discourse!

You can use various strategies to limit or disable GC. Life in the Fast Lane | The D Blog

Or you can use the Better C dialect, (which is actually object oriented etc even though the name suggests otherwise). Better C - D Programming Language

2 Likes

XSLT<->XML. Lots of BASIC->C transpiler source code is avail so a YAB2C or YAB2C++ transpiler component seems possible in a short time…

1 Like

Replied in other thread.

Getting back to some C and C++ bashing, a discussion was brought up by some language lawyers about always using structured code constructs instead of non-structured state machines. This brings up a problem when translating non-structured or semi-structured languages like BASIC.

In the following example, scope rules prevent C from creating equivalent syntax:

PROC Z(X,Y)
   IF X=Y
      LET N=1
      LET Y=0
   ELSE
      LET N=2
      LET X=X+1
   ENDIF
   PRINT N,X,Y
ENDPROC

The equivalent C code would normally be:

void z(int x,int y) {
   if (x==y) {
      int n;
      n=1;
      y=0;
   } else {
      int n;
      n=2;
      ++x;
   }
   printf("%d/t%d/t%d/n",n,x,y);
}

This example is a little contrived but in C, the variable n goes out of scope in both the if and the else so it won’t even compile. When translating from BASIC to C, those curly brace scoping rules become a major pain! There are 2 ways to solve it but both are ugly.

One is to define preprocessor macro magic in a header file written concurrently to the C file so any variable declaration is moved to just inside the curly brace after the function definition.

The other is to reinvent the structured programming commands themselves using a non-structured state machine. I’ve explained this position in my YAB2C++ thread. This didn’t appease the language lawyers.

I had to get this off my chest or I wouldn’t sleep tonight. I just had reread the linked thread. Good-night all!

If you only problem is variable declarations, you can just move them all to the start of the function? But I expect there will be other similar problems if you do transpiling at a “surface” level like this. What you need to do is parse the languague into an abstract syntax tree and then apply transforms to that until you get something that can be generated in your output language.
Just like a compiler is converting C (or C++ or anything else) to assembler, for example. The input and output languages have little in common

4 Likes

There are non-structured commands and so on that need to use labels as the start of subroutines also. That’s why I abused the switch statement in a loop with loads of fallthrough conditions instead of using structured commands in C.