Recent Posts

Pages: [1] 2 3 ... 10
1
Phix / Re: Phix Introduction
« Last post by John on November 21, 2017, 01:24:09 PM »
Discovered Phix on the IUP mailing list. It seems to have close ties with Euphoria.
2
Phix / Re: Phix Introduction
« Last post by AlyssonR on November 21, 2017, 07:01:15 AM »
Interesting - not a language I've seen before.
3
Phix / Phix Introduction
« Last post by John on November 20, 2017, 09:44:36 PM »
Introduction - Phix is Pete’s Self Hosted Hybrid Interpreter/Compiler


Phix has several advantages over other programming languages:  (Self compiling is a bonus)
  • A remarkably simple, yet flexible and powerful language definition that is easy to learn and use.
  • A high-performance interpreter/compiler much faster than most.
  • Fully managed dynamic data storage with no requirement to allocate or free memory. Variables can grow or shrink to any size without any manual housekeeping.
  • Extensive run-time checking for: out-of-bounds subscripts, uninitialized variables, bad parameter and variable assignments and many more. There are no mysterious machine exceptions -- you always get a full English description of any problem that occurs within your program at run-time, with the exact source line it occurs on, along with a full call-stack listing and a dump of all of your variable values. Programs can be debugged quickly, easily, and more thoroughly.
  • A source level debugger allows execution of programs line-by-line. Tracing can begin (or end) on any line or for any condition, under full programmer control.
  • A built-in execution profiler identifies which lines of code take up the highest percentage of execution time, or are executed the most often.
  • Features of the underlying hardware are usually hidden. Programs are not typically aware of word-lengths, bit-representations, byte-order etc.
  • However, phix also satisfies anyone with a deeper curiosity. There is no hidden wall between the language and the operating system to fully understand how things actually work. Phix can create low-level listing files which show the exact addresses and assembly instructions generated, and also includes a program (filedump.exw) that shows every bit and byte in full detail (within reason, for example icons and other such data are shown in raw hex), for Windows PE, Linux ELF, and other format files.
  • Self-hosted so there is no need to know another language, or obtain any other development tools, to enhance or fix the language itself. You can easily download, install, and recompile phix in less than two minutes! (See the short webcast at http://phix.is-great.org/tutorial.php, and also Recommended Tools.)
  • The Edita programmers editor is freely available, and written in phix with everything you might expect, including multiple and user-definable syntax colouring, multilingual support, intellisense, autocompletion, code folding, integrated help, window painter, full source, and more.
  • Standalone executables can be created simply by adding a "-c" flag to the normal interpret command (or via Ctrl F5 if using Edita). (The detailed assembly listing mentioned above is likewise just a "-d".) There are no complicated compiler options to remember and there is no separate linking phase. A simple "format" directive in the source allows for easy cross-compilation to any other supported system.
  • Phix programs are naturally generic. The example program shows a single routine that will sort any type of data -- integers, floating-point numbers, strings etc. Phix achieves many of the benefits of object-oriented programming, yet in a much simpler way.

Phix Bitbucker Project Repository

Phix Tutorial

Example Program
Code: [Select]
function merge_sort(sequence x)
-- put x into ascending order using a recursive merge sort
integer midpoint
sequence merged, first_half, second_half
     if length(x)<=1 then
         return x  -- trivial case
     end if
     midpoint = floor(length(x)/2)
     first_half = merge_sort(x[1..midpoint])
     second_half = merge_sort(x[midpoint+1..$])
     -- merge the two sorted halves into one
     merged = {}
     while length(first_half)>0
       and length(second_half)>0 do
         if first_half[1]<=second_half[1] then
             merged = append(merged, first_half[1])
             first_half = first_half[2..$]
         else
             merged = append(merged, second_half[1])
             second_half = second_half[2..$]
         end if
     end while
     -- result is the merged data plus any leftovers
     return merged & first_half & second_half
end function
sequence list = {9, 10, 3, 1, 4, 5, 8, 7, 6, 2}
     ? merge_sort(list)

The above example delares a function, a sequence, and then invokes the function and displays the results. It also demonstrates how sequences (flexible arrays) are the real powerhouse of phix.

The output from the program is:
    {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

merge_sort() will just as easily sort {1.5, -9, 1e6, 100} or {"oranges", "apples", "bananas"} .
4
Toolbox / IUP 3.23 Released
« Last post by John on October 12, 2017, 03:51:01 PM »
We just released IUP version 3.23.

We would like to highlight some of the new features:

  • Merge of cells in IupMatrix
  • Watch for global variables and expressions in IupLuaScripter
  • Print of text files in IupScintilla and IupScintillaDlg
  • Support for projects (list of files) in IupScintillaDlg. Configurations can now be saved in the project instead of the global configuration file.
  • Support for multiple files in IupScintillaDlg and IupLuaScripter.
  • Inspect of tables using trees for global and local variables during debug in IupLuaScripter.
and many more features in IupLuaScripter that is becoming a complete development environment for Lua applications, using IUP or not.
You can find the complete list of changes and files for download at:

http://www.tecgraf.puc-rio.br/iup/
http://iup.sourceforge.net/

Best Regards,
Antonio Scuri
5
Scripting Languages / FreeBASIC COM
« Last post by John on September 26, 2017, 11:37:10 PM »
I took a peek at Paul's and Jose WinFBE project and notice a OCX calender example.

Code: FreeBasic
  1. ' ########################################################################################
  2. ' Microsoft Windows
  3. ' Contents: Embedded MonthView Calendar OCX
  4. ' Compiler: FreeBasic 32 bit only
  5. ' Copyright (c) 2016 Jos&#65533; Roca. Freeware. Use at your own risk.
  6. ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
  7. ' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  8. ' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
  9. ' ########################################################################################
  10.  
  11. #define UNICODE
  12. #INCLUDE ONCE "Afx/CWindow.inc"
  13. #INCLUDE ONCE "Afx/COleCon/COleCon.inc"
  14. USING Afx
  15.  
  16. DECLARE FUNCTION WinMain (BYVAL hInstance AS HINSTANCE, _
  17.                           BYVAL hPrevInstance AS HINSTANCE, _
  18.                           BYVAL szCmdLine AS ZSTRING PTR, _
  19.                           BYVAL nCmdShow AS LONG) AS LONG
  20.  
  21.    END WinMain(GetModuleHandleW(NULL), NULL, COMMAND(), SW_NORMAL)
  22.  
  23. ' // Forward declaration
  24. DECLARE FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
  25.  
  26. ' ========================================================================================
  27. ' Main
  28. ' ========================================================================================
  29. FUNCTION WinMain (BYVAL hInstance AS HINSTANCE, _
  30.                   BYVAL hPrevInstance AS HINSTANCE, _
  31.                   BYVAL szCmdLine AS ZSTRING PTR, _
  32.                   BYVAL nCmdShow AS LONG) AS LONG
  33.  
  34.    ' // Set process DPI aware
  35.    ' // The recommended way is to use a manifest file
  36. '   AfxSetProcessDPIAware
  37.  
  38.    ' // Creates the main window
  39.    DIM pWindow AS CWindow
  40.    ' -or- DIM pWindow AS CWindow = "MyClassName" (use the name that you wish)
  41.    pWindow.Create(NULL, "COleCon - Embedded MonthView Calendar OCX", @WndProc)
  42.    ' // Sizes it by setting the wanted width and height of its client area
  43.    pWindow.SetClientSize(580, 360)
  44.    ' // Centers the window
  45.    pWindow.Center
  46.  
  47.    DIM wszLibName AS WSTRING * 260 = ExePath & "\MSCOMCT2.OCX"
  48.    DIM CLSID_MSComCtl2_MonthView AS CLSID = (&h232E456A, &h87C3, &h11D1, {&h8B, &hE3,&h00, &h00, &hF8, &h75, &h4D, &hA1})
  49.    DIM IID_MSComCtl2_MonthView AS CLSID = (&h232E4565, &h87C3, &h11D1, {&h8B, &hE3,&h00, &h00, &hF8, &h75, &h4D, &hA1})
  50.    DIM RTLKEY_MSCOMCT2 AS WSTRING * 260 = "651A8940-87C5-11d1-8BE3-0000F8754DA1"
  51.    DIM pOleCon AS COleCon PTR = NEW COleCon(@pWindow, 1001, wszLibName, CLSID_MSComCtl2_MonthView, _
  52.        IID_MSComCtl2_MonthView, RTLKEY_MSCOMCT2, 0, 0, pWindow.ClientWidth, pWindow.ClientHeight)
  53.  
  54.    ' // Displays the window and dispatches the Windows messages
  55.    FUNCTION = pWindow.DoEvents(nCmdShow)
  56.  
  57. END FUNCTION
  58. ' ========================================================================================
  59.  
  60. ' ========================================================================================
  61. ' Main window procedure
  62. ' ========================================================================================
  63. FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT
  64.  
  65.    SELECT CASE uMsg
  66.  
  67.       CASE WM_COMMAND
  68.          SELECT CASE GET_WM_COMMAND_ID(wParam, lParam)
  69.             CASE IDCANCEL
  70.                ' // If ESC key pressed, close the application by sending an WM_CLOSE message
  71.                IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
  72.                   SendMessageW hwnd, WM_CLOSE, 0, 0
  73.                   EXIT FUNCTION
  74.                END IF
  75.          END SELECT
  76.  
  77.       CASE WM_SIZE
  78.          ' // Optional resizing code
  79.          IF wParam <> SIZE_MINIMIZED THEN
  80.             ' // Retrieve a pointer to the CWindow class
  81.             DIM pWindow AS CWindow PTR = AfxCWindowPtr(hwnd)
  82.             ' // Move the position of the button
  83.             IF pWindow THEN pWindow->MoveWindow GetDlgItem(hwnd, 1001), _
  84.                0, 0, pWindow->ClientWidth, pWindow->ClientHeight, CTRUE
  85.          END IF
  86.  
  87.         CASE WM_DESTROY
  88.          ' // Ends the application by sending a WM_QUIT message
  89.          PostQuitMessage(0)
  90.          EXIT FUNCTION
  91.  
  92.    END SELECT
  93.  
  94.    ' // Default processing of Windows messages
  95.    FUNCTION = DefWindowProcW(hwnd, uMsg, wParam, lParam)
  96.  
  97. END FUNCTION
  98. ' ========================================================================================
  99.  

Seems like a lot of work. Here is a Script BASIC equivalent with a twist of using the .NET calendar control in C# and made COM visible.

Code: Script BASIC
  1. import com.inc
  2.  
  3. cs = CreateObject("Sample.Sample")
  4.  
  5. if cs = 0 then
  6.         print "Failed to create the C# com object did you register the dll with regasm and have .NET installed?"
  7.         return
  8. end if
  9.  
  10. d = CallByName(cs, "GetDate")
  11. print "User Selected date: ", d
  12.  



 
6
Toolbox / Visual Studio Code
« Last post by John on August 18, 2017, 11:30:38 PM »
Quote
Visual Studio Code is a lightweight but powerful source code editor which runs on your desktop and is available for Windows, macOS and Linux. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Python, PHP, Go) and runtimes (such as .NET and Unity).

Free. Open source. Runs everywhere.

7
Interpreters / Re: MY-BASIC
« Last post by wangrenxin on July 24, 2017, 04:53:45 AM »
Sure.

There are some minor bugfix, and some other major improvements for MY-BASIC since my last updating here.

   * Added support for applying `ITERATOR/MOVE_NEXT` and `FOR x IN y/NEXT` for collections, class and referenced usertype. https://github.com/paladin-t/my_basic/wiki/Use-iterators
   * Added support for using a non-referenced usertype larger than `sizeof(void*)`. https://github.com/paladin-t/my_basic/wiki/Use-usertype-values#structure
   * Added interpreter forking functions.
   * Added a structured exception handling ability with interpreter forking. https://github.com/paladin-t/my_basic/wiki/Structured-exception-handling
   * Added a multiple condition branching, which is implemented in MY-BASIC code. https://github.com/paladin-t/my_basic/wiki/Multiple-condition
   * Added support for defining an alias for the `LAMBDA` keyword, which is helpful to write neat code. https://github.com/paladin-t/my_basic/wiki/Lambda-abstraction

Recently I'm working on an App powered by MY-BASIC, which will allow users to write game or application in an IDE with modern BASIC syntax. It's aimed to be similar as PICO-8. I'll initially release it for desktop (Windows), still WIP, yet details and releasing date are TBD.

There are also few API changes, which are easy to figure out.

BTW. don't forget to share your use cases with us via https://github.com/paladin-t/my_basic/issues/13.
8
Interpreters / Re: MY-BASIC
« Last post by John on July 23, 2017, 01:04:23 PM »
I recompiled the My-BASIC extension module for Script BASIC and all seems to have went well. The only thing I had to do is add the extra true argument to the mb_run() function wrapper.

Can you give us an update where things are with My-BASIC?

9
Scripting Languages / Re: Script BASIC Windows 32 bit - Download Available
« Last post by John on February 14, 2017, 02:40:28 PM »
I have finally assembled an Inno install for Script BASIC for Windows 32 bit with extension modules and their dependencies included. This is my first public release in this format and would appreciate any feedback you're willing to offer to make Script BASIC even better for everyone.

If you plan on using the MySQL extension module or use the SBHTTPD proxy web server, I highly recommend installing the 32 bit version of the XAMPP package (and any of the other free packages they offer) for your local  database and Apache web server environment.

Script BASIC Examples and Source


Download Attached
10
Scripting Languages / Re: Script BASIC Windows 32 bit
« Last post by John on February 10, 2017, 01:04:35 AM »
All I have to do now is create the README file and I should be ready to post a public beta of Script BASIC Windows 32 bit packaged  with the Inno installer. (SBWin32_Setup.exe)



Pages: [1] 2 3 ... 10