Author Topic: JADE - A Sneak Peek  (Read 29945 times)

kryton9

  • Guest
Re: JADE - A Sneak Peek
« Reply #45 on: November 10, 2013, 11:23:38 PM »
Jade WXWidgets in Linux Mint 15 VM.

Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Re: JADE - A Sneak Peek
« Reply #46 on: November 10, 2013, 11:24:34 PM »
Been there, done that.

Where is the WINBox version?

Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Re: JADE - A Sneak Peek
« Reply #47 on: November 11, 2013, 09:51:46 AM »
I'm going to be spending my time with the C BASIC side of this effort going forward. AIR has made outstanding progress with the C++ version called JADE. It would be great if others would join in and help bring JADE to a release state. Much of AIR's efforts can be shared with the C BASIC project.

I have found while converting the Wetspot II game to C BASIC that a SB script (eventually a C BASIC program) could do the conversion work and allow the C BASIC project to have a wider variety of examples to use and learn from. My hope is that Charles will find the time to continue with his C emitter project which is how C BASIC was born and provides the missing BASIC functionality that core C depends on external libraries for. I also plan to include the CERN CINT (C interpreter/debugger) as an integral part of the C BASIC solution.



« Last Edit: November 11, 2013, 10:03:39 AM by John »

Offline AIR

  • Moderator
  • Posts: 932
  • Coder
Re: JADE - A Sneak Peek
« Reply #48 on: November 11, 2013, 11:42:21 AM »
FLTK Windows Screenshot.

Compiled under MinGW32 with:
Code: [Select]
g++ -Os fltkdemo.cpp -I /c/Users/arivera1271/FLTK-WIN32/include/ -L /c/
Users/arivera1271/FLTK-WIN32/lib/ -lfltk -mwindows -lole32 -luuid -lcomctl32  -o fltkdemo-win


« Last Edit: November 11, 2013, 11:44:29 AM by AIR »

kryton9

  • Guest
Re: JADE - A Sneak Peek
« Reply #49 on: November 11, 2013, 01:50:52 PM »
BASIC programmers aren't going to really do any of the advanced C++ stuff, like OOP, Templates  and such.
Air has already shown JADE can work with any c/c++ library, so no need to keep adding more examples in my opinion.

I am going to start working on my fork that will be geared towards people coming from OOP type scripting languages
to C++ and for users like me who have been using C++, but want to work with soothing looking code and not has symbolic.

kryton9

  • Guest
Re: JADE - A Sneak Peek
« Reply #50 on: November 11, 2013, 05:10:20 PM »
Congrats AIR on the JADE release, hope people take the time to check it out.

Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
JADE - AIR C++ BASIC
« Reply #51 on: April 16, 2015, 06:38:50 AM »
James posted message about AIR's JADE project and I thought it might be helpful to mention this existing thread. I agree with James that JADE needs more attention.


Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Re: JADE - AIR C++ BASIC
« Reply #52 on: April 16, 2015, 06:43:07 AM »
I think the work AIR has done with JADE (framework) and the KoolB BASIC translator married could be an interesting pair.

Quote from: James Fuller
Don't use guilt by association as a reason to not try it, because AIR is one outstanding coder.

I feel the same way about your fork of BCX. You were also a great programmer/contributor at one time until you joined the BBB. (Bitter BASIC Bunch)

Quote from: Paul Dunn
Didn't JRS start something like that a while ago? IIRC he abandoned it because he couldn't get it to work properly or some such.

Misinformed again Paul. You really need to let go of the past. The C BASIC project which JADE was a fork of, is standard equipment in Script BASIC (basext.h) to extend the already existing #define and macro syntax Peter Verhas instigated.
 
« Last Edit: April 16, 2015, 10:27:33 AM by John »

Offline AIR

  • Moderator
  • Posts: 932
  • Coder
Re: JADE - A Sneak Peek
« Reply #53 on: December 19, 2018, 04:51:35 PM »
Resurrecting this for a quick update:

I've wanted to implement a "FOR..IN" style loop that can be used over container types (like arrays).

Here is an example of it in use (you'll see the old FOR loop commented out):

Code: C
  1. /* CHANGE THIS PATH TO WHERE "jade.h" IS LOCATED */
  2. #include "jade.h"
  3.  
  4. MAIN
  5.         CSTRING s = "This is an example that should be split!";
  6.  
  7.         STRARRAY ret = SPLIT(s);
  8.  
  9.         //   FOR (UINT i = 0 TO i < ret.size() STEP i++) BEGIN
  10.         //          PRINT( ret[i] );
  11.         //   END
  12.  
  13.  
  14.         FOR (CSTRING tst IN ret) BEGIN
  15.                 PRINT(tst);
  16.         END
  17.        
  18.         RETURN 0;
  19. ENDMAIN

[riveraa@MPD /Users/Shared/src/Jade] $ ./split-test
This
is
an
example
that
should
be
split!


Much cleaner.

CURRENT JADE SOURCE  This REQUIRES the "-std=c++11" flag to avoid nagging from the g++ compiler.

AIR.

Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Re: JADE - A Sneak Peek
« Reply #54 on: December 19, 2018, 06:10:07 PM »
I would be lost in SB if SPLITA didn't exist.

Allowing a variable length delimiter is also handy.
« Last Edit: December 19, 2018, 06:13:57 PM by John »

Offline AIR

  • Moderator
  • Posts: 932
  • Coder
Re: JADE - A Sneak Peek
« Reply #55 on: December 19, 2018, 07:16:01 PM »
Code: C
  1. /* CHANGE THIS PATH TO WHERE "jade.h" IS LOCATED */
  2. #include "jade.h"
  3.  
  4. MAIN
  5.         CSTRING s = "Hello World! This is: JADE, splitting strings; using multiple delimiters! Just-for-you!";
  6.  
  7.         STRARRAY ret = SPLIT(s,".,:;!?-");
  8.  
  9.         FOR (CSTRING tst IN ret) BEGIN
  10.                 PRINT(tst);
  11.         END
  12.  
  13.         RETURN 0;
  14. ENDMAIN

Code: [Select]
Hello World
This is
JADE
splitting strings
using multiple delimiters
Just
for
you

Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Re: JADE - A Sneak Peek
« Reply #56 on: December 19, 2018, 07:27:10 PM »
Cool but can you do more than one character at a time?

Code: ScriptBasic
  1. SPLITA xml BY "<food>" TO food
  2.  

Offline AIR

  • Moderator
  • Posts: 932
  • Coder
Re: JADE - A Sneak Peek
« Reply #57 on: December 20, 2018, 01:41:20 AM »
Code: C++
  1. /* CHANGE THIS PATH TO WHERE "jade.h" IS LOCATED */
  2. #include "jade.h"
  3.  
  4. MAIN
  5.         CSTRING s = "Hello World! This is JADE, splitting strings using strings delimiters! Just-for-you!";
  6.  
  7.         STRARRAY ret = SPLIT(s,"This is|strings|,|!");
  8.  
  9.         FOR (CSTRING tst IN ret) BEGIN
  10.                 PRINT(tst);
  11.         END
  12.  
  13.         RETURN 0;
  14. ENDMAIN

Code: [Select]
[riveraa@MPD /Users/Shared/src/Jade] $ g++ -std=c++11 split-test.cpp -o split-test
[riveraa@MPD /Users/Shared/src/Jade] $ ./split-test
Hello World
JADE
splitting
using
delimiters
Just-for-you

With this implementation, you can split on multiple delimiters, both full word and single characters, as long as they are separated by the pipe symbol.  You can also split using REGEX syntax if you want to really go crazy.

Code: C++
  1.         s = "Thu Dec 20 04:22:24 EST 2018";
  2.  
  3.         ret = SPLIT(s,"\\D+");
  4.  
  5.         FOR (CSTRING tst IN ret) BEGIN
  6.                 PRINT(tst);
  7.         END    

The snippet above tells SPLIT to split on all non-numeric items (words and punctuation), returning only numbers:

Code: [Select]
20
04
22
24
2018



AIR.

Offline AIR

  • Moderator
  • Posts: 932
  • Coder
Re: JADE - A Sneak Peek
« Reply #58 on: December 23, 2018, 10:25:43 PM »
I implemented a REPEAT$ function, with an optional delimiter.

Code: C
  1. #include "jade.h"
  2.  
  3. MAIN
  4.     PRINT(REPEAT$("ABC",3));
  5.     PRINT(REPEAT$("ABC",3,", "));
  6.     PRINT(REPEAT$("ABC",3,"\t"));
  7. END
  8.  

$ ./repeat
ABCABCABC
ABC, ABC, ABC
ABC   ABC   ABC


AIR.

Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Re: JADE - A Sneak Peek
« Reply #59 on: December 24, 2018, 12:06:39 AM »
That's a nice combo of features!