Author Topic: DLLC  (Read 9029 times)

0 Members and 2 Guests are viewing this topic.

JRS

  • Guest
Re: DLLC
« Reply #30 on: December 03, 2016, 10:26:44 AM »
Quote
Does VirtualBox offer regular guest additions for Windows 10?

Yes and a selection for Windows 10 as an OS.

This time around I'm using my laptop that has 8 cores and better graphics. Im giving the VM a couple cores and a gig and a half of memory which seems to be enough to run respectfully. I'm using the 32 bit version of Windows 10. Doing the same for Windows 7. I have a 64 bit Windows 7 partition if I want to go there for some reason.

I'm not in love with the Windows 10 UI as it's bland with little distinction. I have to support customers that aren't willing or can't change it to look like Windows 7 even though I like your setup.

I was able to disable one drive, defender, auto updates and all the feedback notifications back to Microsoft. It really runs rather well as a VM. It seems to run faster and smoother that my Win7 32 bit VM.

Update - I do have one problem of adding shared drives. (VirtualBox Linux directories) I'm getting by with Drag & Drop.
« Last Edit: December 04, 2016, 11:35:58 PM by John »

JRS

  • Guest
Re: DLLC
« Reply #31 on: December 04, 2016, 06:12:42 PM »
Mike,

I've been setting Windows 10 up for development and noticed that libpthread.a is now supported and I don't have to use a 3rd party library.


C:\sbgcc\source>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/TDM-GCC-32/bin/../libexec/gcc/mingw32/5.1.0/lto-wrapper.exe
Target: mingw32
Configured with: ../../../src/gcc-5.1.0/configure --build=mingw32 --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp --enable-lto --enable-graphite --enable-libstdcxx-debug --enable-threads=posix --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libstdcxx-threads --enable-libstdcxx-time --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --disable-symvers --enable-cxx-flags='-fno-function-sections -fno-data-sections -DWINPTHREAD_STATIC' --prefix=/mingw32tdm --with-local-prefix=/mingw32tdm --with-pkgversion=tdm-1 --enable-sjlj-exceptions --with-bugurl=http://tdm-gcc.tdragon.net/bugs
Thread model: posix
gcc version 5.1.0 (tdm-1)

C:\sbgcc\source>

C:\sbgcc\source\bin\exe>ver

Microsoft Windows [Version 10.0.14393]

C:\sbgcc\source\bin\exe>scriba -v
ScriptBasic v2.2
Variation >>WIN10-32<< build 1
Magic value 859010868
Node size is 16
Extension interface version is 11
Compilation: Dec  4 2016 18:47:54
Executable: C:\sbgcc\source\bin\exe\scriba.exe

C:\sbgcc\source\bin\exe>


While doing a walk-about through the SB source I found this test code that shows how easy it is to work with the embedding API.

Code: C
  1. unsigned long i=0;
  2. unsigned long min,max,act;
  3. pSbData pRetVale;
  4.   while( 1 ){
  5.     i++;
  6.     if( i%10000 == 0 ){
  7.       testa_ReportLeak();
  8. #define PRSEG(X)      alloc_GetStat(X,&min,&max,&act);printf("Segment %s is %d\n",#X,act);
  9.       PRSEG(pProgram->pMEM);
  10.       PRSEG(pProgram->pEXE->pMo);
  11.       PRSEG(pProgram->pEXE->pMemorySegment);
  12.       printf("kukk %d\n",i/10000);
  13.       getchar();
  14.       }
  15.     pRetVale = scriba_NewSbData(pProgram);
  16.     scriba_CallArgEx(pProgram,scriba_LookupFunctionByName(pProgram,"main::pred_1"),pRetVale,0,NULL);
  17.     scriba_DestroySbData(pProgram,pRetVale);
  18.     }
  19. }
  20.  
  21.   printf("testvar type is %d\n",scriba_GetVariableType(pProgram,
  22.   scriba_LookupVariableByName(pProgram,"main::testvar")));
  23.   scriba_GetVariable(pProgram,
  24.                      scriba_LookupVariableByName(pProgram,"main::testvar"),
  25.                      &psb
  26.     );
  27.   printf("testvar from C is %s\n",scriba_GetString(pProgram,*psb));
  28.  
  29.   scriba_SetVariable(pProgram,scriba_LookupVariableByName(pProgram,"main::testvar"),
  30.                      SBT_ZCHAR,1,2.2,"kukac",4);
  31.   scriba_CallArgEx(pProgram,scriba_LookupFunctionByName(pProgram,"main::thatfunc"),&RetVale,4,p);
  32.  


« Last Edit: December 04, 2016, 09:22:04 PM by John »

Mike Lobanovsky

  • Guest
Re: DLLC
« Reply #32 on: December 05, 2016, 01:25:29 AM »
John,

Tell you more: if you have Windows 10 Anniversary Edition then you can have full-blown Ubuntu directly in the Windows console. :D

It's like a mirror reflection of Wine: Windows now has its own Linux subsystem with apt, ssh, rsync, find, grep, awk, sed, sort, xargs, md5sum, gpg, curl, wget, apache, mysql, python, perl, ruby, php, gcc, tar, vim, emacs, diff, patch... And a zillion more directly from the Ubuntu archives!

You don't need no dual bootin' any more, John. If you're under Windows again, you're in a programmer's heaven. :)

JRS

  • Guest
Re: DLLC
« Reply #33 on: December 05, 2016, 09:43:45 AM »
I'm running the most current version of Windows 10 32 bit. I don't think the Ubuntu stuff is offered in the 32 bit version of Windows 10.

I'm happy just the way things are. I have no need for a Linux abortion running in Windows.

The article states this isn't the Linux kernel running with Windows but a busybox like implementation. (Microsoft's Windows Android effort redirected)


« Last Edit: December 05, 2016, 10:30:58 AM by John »

Mike Lobanovsky

  • Guest
Re: DLLC
« Reply #34 on: December 05, 2016, 12:50:23 PM »
MS Windows Linux Subsystem was created in close co-operation with Canonical, so it shouldn't be a piece of goofy junk like Wine or ReactOS that will require decades to debug and complete. I think its server functionality will be fully unlocked in Windows Server 2016 any time soon -- that's the only reasonable explanation for the entire effort, the only one ever taken by MS to jump onto the trendy bandwagon in time. :)

And it will only be a matter of months before some inquisitive enthusiasts find ways and means to add Linux GUI functionality to, or unlock it in, the current terminal-only implementation, if only MS doesn't do that itself to do away with Oracle, VMware et al. virtual machine vendors' competition altogether in one swoop.

What made you favor a 32-bit installation over 64 bits?

JRS

  • Guest
Re: DLLC
« Reply #35 on: December 05, 2016, 03:36:16 PM »
Quote
What made you favor a 32-bit installation over 64 bits?

I don't plan to run Office or Photoshop in the VM and only doing 32 bit Windows development. (no SysWoW64 emultation) The 32 bit version runs much faster in a VM than the 64 bit version does in its own partition running native. I also set the preferences for speed over fluff. I see little interest in the average Windows developer to invest in 64 bit.
« Last Edit: December 05, 2016, 08:15:18 PM by John »

JRS

  • Guest
Re: DLLC
« Reply #36 on: December 06, 2016, 03:56:23 PM »
If you don't need a Linux sub-system for your Windows 10 install, consider busybox-w32.


C:\Users\John>busybox
BusyBox v1.26.0-FRP-811-g71ecc80 (2016-11-29 13:35:05 GMT) multi-call binary.
(mingw32-gcc 6.2.0-1.fc25; mingw32-crt 5.0.0-1.fc25)

BusyBox is copyrighted by many authors between 1998-2015.
Licensed under GPLv2. See source distribution for detailed
copyright notices.

Usage: busybox [function [arguments]...]
   or: busybox --list
   or: busybox --install [DIR]
   or: function [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  The shell in this build
        is configured to run built-in utilities without $PATH search.
        You don't need to install a link to busybox for each utility.
        To run external program, use full path (/sbin/ip instead of ip).

Currently defined functions:
        [, [[, ar, ash, awk, base64, basename, bash, bunzip2, bzcat, bzip2, cal, cat, catv, chmod, cksum, clear, cmp,
        comm, cp, cpio, cut, date, dc, dd, df, diff, dirname, dos2unix, dpkg-deb, du, echo, ed, egrep, env, expand,
        expr, false, fgrep, find, fold, ftpget, ftpput, getopt, grep, groups, gunzip, gzip, hd, head, hexdump, id,
        ipcalc, kill, killall, less, ln, logname, ls, lzcat, lzma, lzop, lzopcat, man, md5sum, mkdir, mktemp, mv, nc,
        od, patch, pgrep, pidof, printenv, printf, ps, pwd, rev, rm, rmdir, rpm2cpio, sed, seq, sh, sha1sum, sha256sum,
        sha3sum, sha512sum, shuf, sleep, sort, split, stat, strings, sum, tac, tail, tar, tee, test, touch, tr, true,
        truncate, uname, uncompress, unexpand, uniq, unix2dos, unlink, unlzma, unlzop, unxz, unzip, usleep, uudecode,
        uuencode, vi, wc, wget, which, whoami, whois, xargs, xz, xzcat, yes, zcat

C:\sbgcc\modules>busybox date
Tue Dec  6 15:54:31 Pacific Standard Time 2016

C:\sbgcc\modules>busybox sh
C:/sbgcc/modules $ ls -l
total 3864
-rw-rw-r--    1 John     John         45568 Dec 01 22:55 cgi.dll
-rw-rw-r--    1 John     John         12800 Dec 01 22:55 cio.dll
-rw-rw-r--    1 John     John        245760 Dec 05 21:00 curl.dll
-rw-rw-r--    1 John     John         21504 Dec 01 22:55 dbg.dll
-rw-rw-r--    1 John     John         45568 Dec 01 22:55 dllc.dll
-rw-rw-r--    1 John     John         53248 Dec 02 23:58 dyc.dll
-rw-rw-r--    1 John     John        131072 Dec 05 22:42 gfx.dll
-rw-rw-r--    1 John     John         16896 Dec 01 22:55 hash.dll
-rw-rw-r--    1 John     John        321024 Dec 01 22:55 js.dll
-rw-rw-r--    1 John     John         26112 Dec 01 22:55 mt.dll
-rw-rw-r--    1 John     John         56320 Dec 01 22:55 mxml.dll
-rw-rw-r--    1 John     John         24064 Dec 01 22:55 mysql.dll
-rw-rw-r--    1 John     John         20992 Dec 01 22:55 nt.dll
-rw-rw-r--    1 John     John         17920 Dec 01 22:55 odbc.dll
-rw-rw-r--    1 John     John         52224 Dec 02 19:49 pui.dll
-rw-rw-r--    1 John     John         50688 Dec 01 22:55 re.dll
-rw-rw-r--    1 John     John        458752 Dec 01 22:55 sbt.dll
-rw-rw-r--    1 John     John         22016 Dec 01 22:55 sdbg.dll
-rw-rw-r--    1 John     John        660480 Dec 01 22:55 sqlite.dll
-rw-rw-r--    1 John     John         15872 Dec 01 22:55 t.dll
-rw-rw-r--    1 John     John         12288 Dec 01 22:55 trial.dll
-rw-rw-r--    1 John     John        107008 Dec 01 22:55 zlib.dll
C:/sbgcc/modules $ diff --help
BusyBox v1.26.0-FRP-811-g71ecc80 (2016-11-29 13:35:05 GMT) multi-call binary.

Usage: diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2

Compare files line by line and output the differences between them.
This implementation supports unified diffs only.

        -a      Treat all files as text
        -b      Ignore changes in the amount of whitespace
        -B      Ignore changes whose lines are all blank
        -d      Try hard to find a smaller set of changes
        -i      Ignore case differences
        -L      Use LABEL instead of the filename in the unified header
        -N      Treat absent files as empty
        -q      Output only whether files differ
        -r      Recurse
        -S      Start with FILE when comparing directories
        -T      Make tabs line up by prefixing a tab when necessary
        -s      Report when two files are the same
        -t      Expand tabs to spaces in output
        -U      Output LINES lines of context
        -w      Ignore all whitespace
C:/sbgcc/modules $


I use vi, diff, grep, ... all the time when working in a console under Linux. The sh/bash shells are much better than using Windows batch files.



« Last Edit: December 07, 2016, 03:34:39 PM by John »

JRS

  • Guest
Re: DLLC
« Reply #37 on: December 08, 2016, 01:14:50 PM »
TDM-GCC doesn't have the Linux configure script functionality and many libraries require it before the make process. I decided to install MinGW32  which includes mysy which acts like a Linux shell. I haven't tried recompiling my Script BASIC Windows 10 build with it yet and plan to use MinGW32 for library dependency builds or at least build the Makefile from the ./configure  and use TDM-GCC.

Strange to see such a difference in final execution size for these gcc Windows solutions.

MinGW-32 (msys)

John@Windows-10 /home/john
$ cat hello.c
#include <stdio.h>

int main(int argc, char **argv)
{
   printf ("Hello\n");
   return (0);
}

John@Windows-10 /home/john
$ gcc hello.c -o hello.exe

John@Windows-10 /home/john
$ hello
Hello

John@Windows-10 /home/john
$ ls -l hello.*
-rw-r--r-- 1 John Administrators   101 Dec  8 13:58 hello.c
-rwxr-xr-x 1 John Administrators 59634 Dec  8 14:01 hello.exe

John@Windows-10 /home/john


TDM-GCC-32 (busybox)

C:\TDM-GCC-32\test>busybox sh
C:/TDM-GCC-32/test $ cat hello.c
#include <stdio.h>

int main(int argc, char **argv)
{
   printf ("Hello\n");
   return (0);
}
C:/TDM-GCC-32/test $ gcc hello.c -o hello.exe
C:/TDM-GCC-32/test $ ls -l hello.*
-rw-rw-r--    1 John     John           101 Dec 08 13:58 hello.c
-rwxrwxr-x    1 John     John         27928 Dec 08 14:06 hello.exe
C:/TDM-GCC-32/test $ hello
Hello
C:/TDM-GCC-32/test $





.
« Last Edit: December 08, 2016, 07:34:31 PM by John »

JRS

  • Guest
Re: DLLC
« Reply #38 on: December 08, 2016, 08:11:50 PM »
I now have a Makefile that compiles a Script BASIC build with all the extension modules I currently plan to include for Windows 10 32 bit.



.

Mike Lobanovsky

  • Guest
Re: DLLC
« Reply #39 on: December 08, 2016, 10:23:55 PM »
Strange to see such a difference in final execution size for these gcc Windows solutions.

Sizes may vary greatly depending on the compiler/linker default switch settings which are different for the two distros. IIRC MinGW usually tends to create larger exes because it tries to link in alien (non-native to Windows) POSIX threads and SEH while TDM-GCC is on default substantially more system-friendly in this respect.

If you ever decide to try recompiling SB for x64 Windows, you may also consider J.C.Fuller's recommendation to try out nuwen's custom recompilation of MinGW.

JRS

  • Guest
Re: DLLC
« Reply #40 on: December 09, 2016, 10:22:37 AM »
I actually built a 64 bit TDM-GCC-64 version about a year ago. This is when I discovered how baron the Windows 64 bit world is.

I'm tryiing to build an Inno setup for Script BASIC Windows 32 bit. Hopefully more folks with give it a try if the install is automatic.

I decided not to use the math keyword enhancements added by Tom to scriba/sbhttpd. After looking at a diff of the mod, I noticed it shifted more than half of the SB keyword codes down by one. I plan on reworking the math additions as an extension module in an upcoming release.
« Last Edit: December 09, 2016, 11:53:16 AM by John »

Charles Pegge

  • Guest
Re: DLLC
« Reply #41 on: December 11, 2016, 02:53:15 AM »

Hi John,

Here is the latest tested DLLC binary from the latest (11 December 2016) OxygenBasic.

No paths are specified, so there should be no problems with DLLC build, but you must copy it into the required location.

To run any JIT compiling you must put Oxygen.dll alonside dllc.dll. (modules folder)

.

JRS

  • Guest
Re: DLLC
« Reply #42 on: December 11, 2016, 08:15:46 PM »
Thank you Charles!

DLLC compiled fine on Windows 10 without issue.

I will give DLLC some Windows 10 testing before including it in the Script BASIC for Windows (7-10) setup file I'm preparing.

It looks like I might be able to use Dave's IDE/Debugger as the featured GUI interface to Script BASIC on Windows 10.  The console mode scriba and Windows version of it, sbwin will also be included. I'm using Inno for the install setup file.
« Last Edit: December 11, 2016, 08:55:52 PM by John »

JRS

  • Guest
Re: DLLC
« Reply #43 on: December 18, 2016, 09:56:19 PM »
I was going through some old code and discovered the DYC script that was the motivation for DLLC

Code: Script BASIC
  1. DECLARE SUB DLL ALIAS "dyc" LIB "dyc"
  2.  
  3. DLL "mc,i,iup.dll,IupOpen,PP",0,0
  4. win = DLL("mc,p,iup.dll,IupCreate,Z","dialog")
  5. lbl = DLL("mc,p,iup.dll,IupCreate,Z","label")
  6. DLL "mc,p,iup.dll,IupSetAttributes,PZ",lbl,"""
  7.  TITLE="Hello World!",
  8.  PADDING=100x75,
  9.  FONT="Arial, BOLD 24"
  10.  """
  11. DLL "mc,p,iup.dll,IupAppend,PP",win,lbl
  12. DLL "mc,i,iup.dll,IupShow,P",win
  13. DLL "mc,i,iup.dll,IupMainLoop,P",0
  14. DLL "mc,i,iup.dll,IupClose,P",0
  15.  





.
« Last Edit: December 19, 2016, 10:57:40 PM by John »

JRS

  • Guest
Re: DLLC
« Reply #44 on: December 20, 2016, 09:49:30 PM »
Charles,

I'm getting ready to release a Script BASIC 2.2 Windows 32 bit setup install and I'm including a featured example program for each of the extension modules. DLLC can do so many things based on the notes in the code and the examples you have written. Can you create an example script that would feature DLLC's abilities? It would be much appreciated as I'm working on examples for the others.

John