Arguably the time for that is when v1 is released.
Printable View
I think that would be reasonable. The hesitation in the beginning is definitely; so many promised VB replacements never going anywhere, no good gauge of how fast progress would be or whether it would start gaining traction. But revisiting the issue now, I think the case is a lot more clearer. tB is a real thing, not vaporware, it's already extremely far along, numerous people are using it, and the creator is clearly dedicated to keeping it moving at the same astounding pace it has over the past 2 years.
BETA 315 of the twinBASIC programming IDE is now available...
Download from here... https://github.com/twinbasic/twinbasic/releases
- Click on "Assets" for the latest release
- Download and Extract the ZIP file into a local folder
- Then run the twinBASIC.exe from that local folder
How to install https://nolongerset.com/how-to-install-twinbasic/
Mulitple threads is definitely a good idea, and moderators including myself have said it multiple times. For now, they should be placed in the "Other Basic" forum, like this thread... when a TwinBasic forum is made, moderators/admins will move the threads over.
This is actually baka's thread, so baka should get to choose a name change (and can do it by editing post #1, or asking a moderator).
Quote:
So tB forum when? :D
Quote:
Totally agree. It is clearly time for twinBASIC to have its own subforum (and Codebank) here.
The main factor is the number of threads... we currently have 5, but there would have been at least 5 more if they weren't merged into this thread.Quote:
Arguably the time for that is when v1 is released.
We might also decide to wait for the release of v1, but I don't know.
BETA 316 of the twinBASIC programming IDE is now available...
Download from here... https://github.com/twinbasic/twinbasic/releases
- Click on "Assets" for the latest release
- Download and Extract the ZIP file into a local folder
- Then run the twinBASIC.exe from that local folder
How to install https://nolongerset.com/how-to-install-twinbasic/
Recommend your favourite BASIC-like programming languages...
16 Best BASIC-like programming languages
https://www.slant.co/topics/9807/~ba...ming-languages
twinBASIC is in the list...
https://www.slant.co/topics/9807/vie...ages~twinbasic
BETA 317 of the twinBASIC programming IDE is now available...
Download from here... https://github.com/twinbasic/twinbasic/releases
- Click on "Assets" for the latest release
- Download and Extract the ZIP file into a local folder
- Then run the twinBASIC.exe from that local folder
How to install https://nolongerset.com/how-to-install-twinbasic/
Twinbasic allows you to set third-party OCX control properties in a form
This function is good, so you have a lot of controls, if. NET controls can also set properties here, so there are thousands of controls
But he can generate a form of DLL, and can generate dozens of K of standard DLL, a little wizard
Assuming he is VB.NET source code, debugging with VB.NET dynamic compilation function, and then compilation of EXE, with a form to be attached to a 1000KB or so of the LIB or runtime static compilation in it.
Some time ago testing, found a lot of problems, a stream of standard DLL can run for a while can not run, the latest version is much more stable.
Now the main problem is the generation of COM DLL and OCX control, in VB6 IDE can not run, to compile generated EXE can be called normally.
Anyway, this is a great product that does most of what we want. Generate 64-bit program, compatible with VB6 old project, if still can put. NET UI controls are also wrapped in for use with TWINBASIC.
If you can directly write some VB.NET simple code, JS code mixed programming, it is very convenient.
At least if you can quote. NET DLL component library is also very convenient, WEBSOCKET in VB has been a headache, I do not know TWINBASIC can really simple implementation of websocket server and client.
Compile-generated EXE with forms
VB6 is only 24 kilobytes,
twinbasic has 1MB
vfb generated form EXE 150KB
I do not know when you can have the Chinese version, set a file as a language package, such as the default is language_ini English, IDE can be set to choose language_cn.ini (Chinese language package)
use webview2 control need to install twinpack(packages
The simplest way to use a webview control is to be a hassle for VB6 programmers.
It would be convenient if references were divided into three types: OCX controls,COM DLLS, and Twinbasic's own virtual controls.
The complete tutorial
https://blog.csdn.net/xiaoyao961/art...ails/130926012
Since twinbasic must have the EDGE runtime installed first, the webview2 control should be displayed in the Controls toolbox by default, without requiring additional complex references to be added.
Assembly code support can also be developed. Inserting assembly code directly into the IDE can be wrapped as a function, module, or inserted directly into the compiled code.
In addition, a pure web interface can be developed.
Just as vb6 was the first to support the development of Windows 6.0 interfaces, it will load a specialized UI component, just like office forms2.0.
Only certain UI controls and code can be used in wince.
If you use web pages as interface elements, then changing to the server version is easy. In a few simple steps, you can turn the software into a direct operation on the phone, server running EXE or just a DLL.
This is also the VB6 function into the cloud a new way to play. After all, a Microsoft cloud can cost as little as $100 a year, or $20 in China. An operating system runs on the server 24 hours a day.
We can use software in the cloud directly from our phones, tablets, or other computers.
Web version IDE will come out, later open the web page can write code, support webpage drag and drop button, form control (visual form design), server code directly with JS, or any language implementation (.NET,JAVA,PYTHON, swift).
The web page just shows an operation interface and some interface changes.
vbsedit is also used to write 64-bit game scripts, which would be more convenient if twinbasic could put assembly code directly into it. It runs several times faster
Attachment 187727
First, TWINBASIC is almost 100% compatible with vb6 and has some of the syntax of VB.NET.
As a result, he cannot be queried and asked questions in VB6 and the code base, which is unfair and unreasonable.
In theory, if the IDE can also write VB.NET code, you can write VB6 code.
He should have two subject posts, one for VB6 and one for VB.NET.
It's better if the development company pays a little bit for this forum, otherwise it doesn't belong to VB6 or VB.NET,
It is like F# language, can never be searched.
Hope the forum administrator can pay attention to this problem. You can't let them advertise for free without paying, and you can't let VB6 fans have access to such a great tool.
Just a few months ago I tested generating standard DLLS and COM DLLS, sometimes can be called by VB6, next time not, extremely poor stability. The test was done today, and it can be used normally, and most of the problems have been solved.
VB3.0 is equivalent to entering the state, once reached VB5.0 is a commercially stable product.
It was a mistake to put it in the "K" language and put it in a new section. In fact, I think the best way is to ask and publish CODE snippets directly on VB6 and VB6 CODE BANK. The example project is fine, but it should be clearly stated that it should only work with TWINBASIC or with VB6.
For some of my VBA questions, I don't need to go to the EXCEL forum for help, it's completely VB6, just some data types need to be converted to LONGPTR and so on.
I hate long class names, like this UIA Automation, which I would do if I developed it:
Finditem(byname,bykeyid)
item.click
item.setvalue
50 word code, Microsoft makes us write 3000 word code, that is the root cause of IE's failure.
Code:Set UIA = New UIAutomationClient.CUIAutomation
Dim Root As UIAutomationClient.IUIAutomationElement
Set Root = UIA.GetRootElement
Debug.Print Root.CurrentName, Root.CurrentLocalizedControlType
'Shell "D:\Program Files\Tencent\WeChat\WeChat.exe", vbNormalFocus
'定位微信搜索框
Dim Condition1 As UIAutomationClient.IUIAutomationPropertyCondition
Set Condition1 = UIA.CreatePropertyCondition(UIAutomationClient.UIA_PropertyIds.UIA_ClassNamePropertyId, "WeChatMainWndForPC")
Dim AE_WeChat As UIAutomationClient.IUIAutomationElement
Set AE_WeChat = Root.FindFirst(TreeScope_Children, Condition1)
Debug.Print AE_WeChat.CurrentName
Dim PC1 As UIAutomationClient.IUIAutomationPropertyCondition
Dim PC2 As UIAutomationClient.IUIAutomationPropertyCondition
Dim PC3 As UIAutomationClient.IUIAutomationPropertyCondition
Set PC1 = UIA.CreatePropertyCondition(UIAutomationClient.UIA_PropertyIds.UIA_NamePropertyId, "搜索")
Set PC2 = UIA.CreatePropertyCondition(UIAutomationClient.UIA_PropertyIds.UIA_ControlTypePropertyId, UIAutomationClient.UIA_ControlTypeIds.UIA_EditControlTypeId) '50004
Dim AC As UIAutomationClient.IUIAutomationAndCondition
Set AC = UIA.CreateAndCondition(PC1, PC2)
Dim SearchBox As UIAutomationClient.IUIAutomationElement
Set SearchBox = AE_WeChat.FindFirst(TreeScope_Descendants, AC)
Debug.Print SearchBox.CurrentName
Dim VP As UIAutomationClient.IUIAutomationValuePattern
Set VP = SearchBox.GetCurrentPattern(UIAutomationClient.UIA_PatternIds.UIA_ValuePatternId)
VP.SetValue "马"
'定位发送消息按钮
Dim PD1 As UIAutomationClient.IUIAutomationPropertyCondition
Dim PD2 As UIAutomationClient.IUIAutomationPropertyCondition
Set PD1 = UIA.CreatePropertyCondition(UIAutomationClient.UIA_PropertyIds.UIA_NamePropertyId, "sendBtn")
Set PD2 = UIA.CreatePropertyCondition(UIAutomationClient.UIA_PropertyIds.UIA_ControlTypePropertyId, UIAutomationClient.UIA_ControlTypeIds.UIA_ButtonControlTypeId) '50000
Dim AC2 As UIAutomationClient.IUIAutomationAndCondition
Set AC2 = UIA.CreateAndCondition(PD1, PD2)
Dim SendBtn As UIAutomationClient.IUIAutomationElement
Set SendBtn = AE_WeChat.FindFirst(TreeScope_Descendants, AC2)
Debug.Print SendBtn.CurrentName
SendBtn.SetFocus
Dim IP As UIAutomationClient.IUIAutomationInvokePattern
Set IP = SendBtn.GetCurrentPattern(UIAutomationClient.UIA_PatternIds.UIA_InvokePatternId)
IP.Invoke
End Sub
I looked at some examples of the latest version and some of the controls are grotesque and completely transparent.
In fact, transparency is just a property, can be used to copy the background window graphics method to achieve. I have written several source code, can achieve 100% transparent effect.
It's just that there are conflicts when multiple controls overlap, and we can ignore these minor issues.
Like some people developed VBCCR or what a set of controls (including buttons, table controls, etc.), if you can not achieve transparency, just say you can replace Microsoft's enterprise version of controls or add some UNICODE text function, but can not make people feel very beautiful effect.
Attachment 187730
If you use all UI components such as cario or gtk, or directly use web elements as the UI, all button table controls are transparent, and the entire interface has only one handle.
So in theory you can support hundreds of thousands of controls, just like a web page, no one ever said, our page uses 3000 elements and the page doesn't display or crashes, right?
visual freebasic, winfbe,fbedit
a new ide ,can make The fact that he can use his own IDE to build an IDE like VSCODE is enough to show that he can implement relatively large projects. But whether it is easy to use is a difficult problem. Mostly, he's more like VB6, VC++, or VB.NET
VB6 source code can be used to achieve the service process. A DLL that is automatically loaded at startup and has SYSTEM permissions.
It would make a lot of sense to make it into a sample code.
Service procedures, standard DLL, COM DLL, ocx controls, EXE, web page before and after end integration, a variety of functions have, very convenient.
In addition, VB6 can controls.add ("BUTTON"),new form1, and other ways to achieve dynamic creation of CONTROLS, control arrays, form copies. I wonder if TWINBASIC implements these features?
Use.net control or VB6 form designer control properties, too long, if can add a search properties will be more convenient. Or you can put commonness first and automatically keep track of how many times an attribute is used.
Such as label1 caption, text1. Text, webview. Navagrit
For the control's calling methods, as well as events, it would be nice if you could also sort them by the most used.
Visual freebasic, for example, now has 30-50 controls, ICONS too small to find, if the user can replace the control icon, change the order, remove the internal standard control never used.
That would be more convenient.
If you turn the web control into a button, text box and other controls instead, the generated EXE can be implemented with 127.0.0.1 or directly open MAIN.HTM. If you change the IP, you can run it on a LAN server, or on a Microsoft cloud server.
Gawd ... please ...
STOP SPAMMING THIS FORUM!
Nearly everything you post is:
- in barely decipherable english
- in most cases totally unrelated to the given thread-topic
- contains codesnippets of other developers, who you don't mention as authors in your reposts
You come across as the guy who's "crashing the wedding" (by defecating on each table in his field of view).
Olaf
twinBASIC status update:
twinBASIC Update: May 28, 2023
Highlights include a new home for twinBASIC documentation (docs.twinbasic.com) and an update on twinBASIC's slant.co language ranking.
https://nolongerset.com/twinbasic-update-may-28-2023/
BETA 318 of the twinBASIC programming IDE is now available...
Download from here... https://github.com/twinbasic/twinbasic/releases
- Click on "Assets" for the latest release
- Download and Extract the ZIP file into a local folder
- Then run the twinBASIC.exe from that local folder
How to install https://nolongerset.com/how-to-install-twinbasic/
VB6 Programming, please post only in dedicated thread about tB releases. And please post some real "update" information like the change log as all your posts can be considered pure spam with useless info.
Well out of all that incoherent mess, I could at least find one thing I understood and definitely agree with :)
tB can't rival truly surpass VB in power until it has some mechanism to insert ASM, preferably inline, but at least linked in functions. Of course you can execute thunks in memory just like VB6, so long as you're not relying on VB6 internals that aren't replicated.
You've misunderstood what the WebView2 runtime is. It allows you to create e.g. a Browser control, but MS does not provide one itself. It's also not really a complex reference; it's one box to check in the references list, TWINPACK PACKAGES->WebView2 Package. That adds the basic implementation Wayne made. You want inline assembly but balk at needing to add a reference? :confused:Quote:
Since twinbasic must have the EDGE runtime installed first, the webview2 control should be displayed in the Controls toolbox by default, without requiring additional complex references to be added.
What I mean is that you can show a webview2 control like a text box, a button,make for basic control.
After the software is installed, it automatically shows that no additional additions are needed.
If the control is not referenced on the form, it does not bring in that entire webview folder.
Because I started by adding various OCX datagrid controls. The WebBrowser control,
The control cannot be displayed, and I need to close the IDe dep settings later.
This is not true. The "WebBrowser" control is an Internet Explorer based, ancient control, unrelated to WebView2. The WebView2 runtime contains no control.
And how do you determine what 3rd party controls are in the list? Why WebView but not any of the hundreds of others?
That's why I created the dedicated thread about tB releases https://www.vbforums.com/showthread....-Beta-releases
Now that VBForums are considering a dedicated forum and codebank for twinBASIC it makes sense to have threads about each topic (the mods will migrate the twinBasic threads to the new forum if and when it is created).
I'm sure users who have become accustomed to checking this thread for news of new twinBASIC releases will soon realise there is a new thread.
webview2,websocket(server and client),If some of the newer technologies are turned on Default Load, and it does not need complicated settings to use.This will make it easier to get started.
I just did the test today, and one person told me that there are three examples about this webview2 control, and I only found two.
I heard a long time ago that this might support Microsoft's edge browser.
Okay, the hard part is I'm going to add those third-party grid controls. Other OCX controls. By default, it cannot be loaded, only to see that it is loaded successfully, but it does not appear in the toolbox.
After a few more tries, he showed up again. Another control is missing. This grid control tells me that I need to turn off the dep option?
In fact, I have never been malicious.It just points out some problems and some good suggestions.
However, some methods are very difficult to implement.
Maybe the developer of this software may think that I am ordering him that you must complete this function, but I really don't mean that.
For example, we compile and generate a program in the form with a size of about 1000 kb.
This shows that our program itself, which has a static library, can actually be treated as a runtime DLl. If it can be separated. Multiple self-developed programs all point to the same directory, or put it in the system directory. In this way, the main program actually developed may be only 200 KB. If 10 gadgets are developed, he can also share the same runtime.
Great care must be taken with this because one of the stated goals of TwinBASIC is multiplatform targeting. Assuming this means to include targets like MAC and Android, hand-written assembly would reduce the portability of the code.
You could end up with situations where people release libraries that contain platform specific assembly and all hell would break loose when they try to compile it for another platform.
It seems that ambition is very powerful. It is possible to make development tools like b4a, b4I or swift.
It's just that for most of us, it's great to be able to replace vB6.
For many developers, what we need is a simple and small development tool like vscode.It's just that he doesn't do form design, and he has all kinds of debugging functions.
VB. Net, vs 2020, these development tools are so huge that they may take up 50 ~ 100g of space on the hard disk after installation.
If the original vs 2008, it can import VB6, the project is basically error-free, and then install the package as far as possible not more than 500 megabytes.And it can also be statically compiled like .net core. Generate a standalone exe, or put all the required files in a directory, which is only 50 to 100 megabytes.
The most important thing is that if it doesn't involve the runtime of .net, it only needs to use basic functions like VC + +, and it may not compile more than 10 megabytes at most.
Microsoft has continued VC + +, but the original VB6 is no longer available.The VB. Net is equivalent to Java and runs on a virtual machine.
Last I checked, TwinBASIC requires no runtime. Not even VB6 works like this. It's closer to C/C++ than VB6 in that regard.
Completely false. .Net applications run native code. Also, the latest versions of C# even allow you to write extremely fast allocation-free code, something only lower level languages like C/C++ and perhaps Rust can do.
As well as what Niya said in https://www.vbforums.com/showthread....=1#post5607201
Also consider that there is a big difference between writing ASM code and writing optimised ASM code. Modern CPUs are very complex when you take into account things like caching, branch prediction, return address prediction, and that isn't taking into account the various SIMD instruction sets (SSE, AVX, AVX2, AVX-512 just on x64 alone).
It would be much better having a compiler that can generate correct, optimised assembler instead; if the compiler / runtime / framework / whatever can also expose platform neutral wrappers over lower level functionality then you can get the best of both worlds.
+1
And in case TBs/Waynes intention, to finally use LLVM for (optimized) code-generation at some point -
will come to frution, then there's not much left over, what one could wish for in this regard -
(translating higher-level language-instructions into highly optimized Assembly for different arch-backends).
Olaf
I'd also add that hand-written assembly is great for overcoming the limits of a language, runtime or compiler. However, given that TwinBASIC is in active development, it would be better to just ask Wayne to address these limits himself before resorting to hand-written assembly.
VB6 hasn't been in active development for 20+ years so assembly is a such great fit for it. You can access things like real bit shifting, SIMD instructions or string instructions using assembly in VB6. Modern languages typically provide these things in one way or another than doesn't require hand-written assembly and it would usually be better than any thing we'd come up with ourselves anyway.
All that being said, having the ability to embed assembly in your code will be a nice feature to have but restraints MUST be placed on it so people don't end up throwing assembly around all willy nilly and creating a nightmare for people trying to compile your code on other platforms.
A good restriction might be to only allow it in DLL projects since DLLs are guaranteed to only run on Windows which itself only runs on x86 processors. You could also restrict the type of assembly allowed based on project type, for example only allowing ARM assembly for Android projects, assuming TwinBASIC will target Android one day.
There's already numerous aspect of tB that are Windows only... Iirc, Wayne has said the plan is to have a different project type with a restricted feature set. Beyond that it's up to the developers... Yes adding asm will limit cross platform use, but so would building a Windows exe. Adding a Windows API.
Having asm supported means being able to throw a compiler error if you include x86 asm for a non-x86 exe. Ideally you'd be able to emit asm conditionally in each target platform.
tB has already gotten rid of the need for a few asm hacks... But it can never cover 100% of the need, much less at the same speed potential.
Asm would be even more rare than vb6, especially if we could get a few common uses like call by pointer and atomic operations, but to take away the ultimate power of vb6? Nah, we need it.
SharpDevelop is an open source.NET IDE, developed in C , which supports C # development, VB. Net development, provides its own compiler, and other functions from the initial development to the present. What is more worth learning is that the core of SD is a plug-in management system, which does not implement any specific functions, but only reserves extended interfaces.
In SD, there are physically three items, which are ICSharpCode. Core, ICSharpCode. SharpDevelop, and StartUp First, the ICSharpCode. Core is the basic plug-in management system of the system, which provides the plug-in structure, plug-in hooking, predefined interfaces, plug-in tree, and various services of the system. This part is called the Core of SD. The ICSharpCode. SharpDevelop is each function module of SharpDevelop, which is the realization of the specific functions of SD, as well as the interface commands, called the Base part of SD. StartUP is responsible for the startup part of SD, as well as resource files such as characters and images.
It would be nice to be able to learn the way they frame things.
What's that have to do with tB?
You need to cut back on the random off topic comments.
再一次,请使用更好的翻译器。
BETA releases of the twinBASIC programming IDE are available for download here...
https://github.com/twinbasic/twinbasic/releases
To install,
- Click on "Assets" for the latest release
- Download and Extract the ZIP file into a local folder
- Then run the twinBASIC.exe from that local folder
Information about current BETA releases of twinBASIC is now posted here...
https://www.vbforums.com/showthread....-Beta-releases
Further details 'How to install':
https://nolongerset.com/how-to-install-twinbasic/
See also:
https://twinbasic.com/
https://twinbasic.com/preview.html
I can imagine accessing SIMD being a need only addressable by embedded assembly. .Net gets around this by providing SIMD specific classes that the JIT recognizes and generates SIMD instructions for. Other compilers(I believe some versions of GCC can do this) use advanced heuristics to identify parallelizable coding patterns for which it then generates SIMD instructions. Both these solutions are a quite involved so I can't imagine Wayne would attend to this need any time soon. However, the ability to write embedded assembly is probably something he could do in an afternoon.
In any case, it would be a temporary solution. He will at some point have to address it in a high level way for TwinBASIC to be competitive with other modern high level languages.
I just remembered something, didn't you write a kernel mode driver once in TwinBASIC fafalone? That right there by itself is a very compelling reason for embedded assembly. Low level kernel mode drivers is one of the few remaining domains of programming where assembly language is still quite viable. If others want pursue such projects in TwinBASIC, they will find this very attractive.
Maybe you can compile dynamically with JS code in the future, and you can get the compiled code.
You may not know that the whole IDe is actually a web page. If you want to change it into other languages, open it with Notepad and replace it. It will become a Chinese version or a French version.
Just now someone was asking, how to read the control attributes on the Liuchuan form? Perfect explanation for him.
twinbasic,Yes, he must have solved them technically.
In terms of cracking vb6 compilation principles, the Russians may have the most say, and they have super-high black technology.
But if he can't make a profit from it, he won't do it.
Perhaps only this software can do the best in this respect.
In fact, the future trend is the web version of IDe development tools, writing code debugging.
Visual Forms Designer.After all, office has now become a web version.Do you think he can still use VBA? You can only use JS in the future.
抛弃vb6,vb.net,He'll be dumping the VBA next.
Now on Microsoft Cloud Server and some other websites, they provide online debugging capabilities for many programming languages, and you may only need to pay $100 a month.
They bought them for billions of dollars.
However, none of them currently support visual tables, and the single design can only return results or run python code in time like an online run.
As long as you want to do it, it is not a problem to crack the compilation principle of VB6, implement almost 100% of the functions, and then go beyond it and add 50% to 200% of the functions.
That's what Delphi did back in the day. c++builder
c# vs java,javascript,vbscript。ie,chrome。 Technically, it can be imitated.But it costs a lot, maybe tens of millions of dollars, maybe hundreds of millions of dollars.Maybe just a million dollars.
I don't know if the engineers who developed VB are still alive. Let them do it. Can we redevelop an IDe like VB6.
Yup I did, and indeed one of the issues that has come up as I've moved onto to drivers that actually do something, is there's a number of common compiler intrinsics that emit asm. One common one is atomic operations... in user mode, these are used for multithreading too, and I solved the lack of those under x64 (because Windows exports them in 32bit versions but not 64bit) by making a C++ DLL to export the intrinsics (see here). But that's not a good solution and it relies on outside modules in other languages. So is tB really going to expose a direct language feature for this rare but important use case? Sure under the hood the functionality might be there somewhere for multithreading, likely limited compared to the full range needed for other tasks, but independently, and in a form that doesn't use any external APIs (because those are a no-go in drivers)?
Here's another example: Strings functions. Do we expect tB to reimplement all the string functions in high performance asm versions not using any external APIs? Though I'd like it support inline C too which would be preferable for implementing these.
e.g. StrRev
Code:public _strrev
_strrev proc \
uses edi esi, \
string:ptr byte
mov edi,[string] ; di = string
mov edx,edi ; dx=pointer to string; save return value
mov esi,edi ; si=pointer to string
xor eax,eax ; search value (null)
or ecx,-1 ; cx = -1
repne scasb ; find null
cmp ecx,-2 ; is string empty? (if offset value is 0, the
je short done ; cmp below will not catch it and we'll hang).
sub edi,2 ; string is not empty, move di pointer back
; di points to last non-null byte
lupe:
cmp esi,edi ; see if pointers have crossed yet
jae short done ; exit when pointers meet (or cross)
mov ah,[esi] ; get front byte...
mov al,[edi] ; and end byte
mov [esi],al ; put end byte in front...
mov [edi],ah ; and front byte at end
add esi,1 ; front moves up...
sub edi,1 ; and end moves down
jmp short lupe ; keep switching bytes
done:
mov eax,edx ; return value: string addr
ifdef _STDCALL_
ret DPSIZE ; _stdcall return
else
ret ; _cdecl return
endif
_strrev endp
end
Yea, embedded assembly would have definitely made things a lot easier here. For example, this is all it takes to implement InterlockedIncrement in assembly:-
It's so simple, I didn't even bother to setup a proper stack frame which has the nice side of removing some of the typical function call overhead. The above works in VB6 with Trick's Add-In using this signature:-Code:use32 ;32 bit code
mov eax, [esp + 4] ;Load the first parameter into EAX.
;This value is a pointer to a 32 bit integer
lock inc DWORD [eax] ;Perform an atomic increment of 32 bit integer
;pointed to by the pointer in EAX
ret 4 ;Clear the stack
The 64 bit version of that would be even simpler since the pointer would be passed in a register instead of on the stack so you'd only need 2 lines of assembly instead of 3.Code:Sub ASMInterlockedIncrement(ByRef value As Long)
It would have made your life a lot easier if you could have done this in TwinBASIC instead of having to go through the trouble you did with the DLLs.
So yea, all in all, I'd say you have a solid argument for the inclusion of inline assembly in TwinBASIC.
Yep. This is a good point.
Actually what you really want here is first class pointer support. The power of C doesn't come from the syntax, a lot of it comes from the fact that pointers are first class citizens in the language. However, I'd strongly advise against this because while such a thing will make TwinBASIC a lot more powerful, you will open up the language to a lot of the ugliness of C, mainly the innumerably amount of undefined behaviors that comes with the language. This is a deep rabbit hole that I don't think BASIC programmers would want to navigate.
There's been some discussion about improving pointer support (one of them here)...
Here's my position on this:
Pointers are *already* a reality of VBx. tB is not looking to change the fact that VBx programs interact directly with low level Windows APIs rather than high level frameworks. So the best course of action here is to make them more friendly, make code using them easier to understand. The existing situation is a lot of work is done with CopyMemory calls and pointer math (with few people bothering to make that large-address safe)... these are more difficult to navigate than true first class pointer support would be. People looking to completely cut themselves off from the lower levels won't want to move off .NET or other framework-heavy languages anyway.
For example, UDTs with pointers to other UDTs...
Type Foo
a As Long
b As Long
End Type
Type Bar
f As LongPtr 'PFOO
End Type
If you receive a Bar UDT, and want it's FOO type, you have to do
Now imagine a world of first class pointer support?Code:Dim tFoo As Foo
CopyMemory tFoo, ByVal tBar.f, LenB(tFoo)
Type Foo
a As Long
b As Long
End Type
Type Bar
f As PointerTo Foo
End Type
Now you need no CopyMemory at all and it's automatically dereferenced when you need it. This is by far the more friendly option in a world where pointers are unavoidable, and so long as nearly every app we all make uses pointers with the Win32 API, that's the one we're living in.
I hear you. However, I'm surprised nobody in that GitHub discussion talked about this. You see, one of the strong points of BASIC since the beginning of time is that the language is well behaved. You could call it a safe language. What do I mean by this? Well consider what happens when you try to read pass the end of an array, you get a "subscript out of range" error. If you try to call a method on an object variable with a null reference, you get an "object variable not set" error. The language gives you guarantees about what would happen under different circumstances. This makes the language very safe and easy to debug.
When you introduce pointers, you are essentially bypassing a lot of abstractions that make the language safe and well behaved. You introduce undefined behaviors into the language. For example, there is no defined behavior for accessing an invalid pointer. It could do nothing today, crash your program tomorrow or erase your hard drive the next day. There is never a guarantee about what would happen. This is very very un-BASIC-like and a source of the most frustrating bugs in languages like C. It also makes it much easier to write exploitable code. Buffer overflow attacks become more likely to succeed without the protection of automatic bounds checking.
Now I know what you might be thinking, which is that you could already walk this path through VarPtr/RtlMoveMemory/PutMem etc. However, these are simply functions. They do not change the fundamental nature of BASIC as a safe, well behaved language. You have to opt into this otherwise you could never find yourself in a situation where a certain operation doesn't have clearly defined results under all conditions.
Here's the long and short of it. I'll never say TwinBASIC shouldn't have pointers. You are correct, they will make the language more powerful and add a lot of convenience but it will also undermine one of the very fundamental parts of BASIC's identity. The real question, will you guys be able to live with that.
.Net has the ability to handle pointers but it's deliberately disallowed in VB.Net. C# allows them and even then, they discourage it's use by forcing you to have to explicitly opt-in to using them. So even Microsoft is weary of pointers being a first class citizen in a language. You guys need to really put some thought into what having first class pointer support in TwinBASIC would really mean for the language.
I don't see how there's any 'opt in' or separation at all when I can't even remember the last time I saw a non-trivial VB program that wasn't calling into APIs. The the purest sense you'd still be opting in, in the sense that nothing is making you use any enhanced pointer functionality, and the language supports ways to avoid it for all the most common situations. We could consider taking the VB6 road of "This is undocumented and unsupported"... like I don't know how official the current situation is with being able to substitute LongPtr for a UDT or As Any.
Public Sub Foo(p As Bar) can be called with Dim ptr As LongPtr: Foo ptr
You make fine points but none of them address the reality that there is no avoiding raw pointers in VBx/tB, for any program of meaningful complexity. Are we saved from buffer overruns and accessing invalid pointers by requiring CopyMemory and manual pointer math? No, in fact I think we open up a *larger* attack surface. Unless there's a world where the use of pointers isn't needed (or at least, only rarely needed), making them friendlier is the only option.
.NET can get away with those restrictions because of the massive, massive frameworks that dramatically limit the need as they wrap nearly the entire API surface. But that's not the road tB is taking, nor the road I'd want it to take. There's a reason so many of us haven't abandoned VB6 for .NET. So given that pointer use will remain pervasive, it's better to have first class support.
I think yourself and Niya are approaching this from different viewpoints.... If you are used to VB6 then having to use APIs to overcome a lot of the limitations is completely normal, plus the language makes it hard to pass things to the APIs as well. CopyMemory, GetMem, PutMem, etc. are required to do a lot of things. I suspect Niya is approaching this from a C# / VB.Net point of view - the language provides easier ways of calling APIs that doesn't require your code to be full of pointers (or in the case of https://learn.microsoft.com/en-us/do...rce-generation this low level code is generated for you).
I think if you are constantly having to use raw memory access and pointers in a a high level language like Basic then something is wrong - either the language is not sufficiently high level enough, or you are using the wrong language for the job. I am willing to admit there will be occasions raw memory access is needed, but these shouldn't be the common case in a high level language. Ideally the environment should take care of as much of this as possible.
Why am I called the Father of Visual Basic?
http://bbs.vbstreets.ru/viewtopic.php?f=27&t=56550
Ruby + EB = Visual Basic
https://blog.csdn.net/xiaoyao961/art...ails/130974374
http://bbs.vbstreets.ru/viewtopic.php?f=101&t=56551
VBStreets Conference • Topic View - § 12. How many lines of code and files are there in VB's own source code?
http://bbs.vbstreets.ru/viewtopic.php?f=101&t=56633
My First BillG Review – Joel on Software
https://www.joelonsoftware.com/2006/...-billg-review/
joel convinced the BASIC team that the Excel team needed something similar to BASIC for Excel. At the same time, he tried to insist that four features should be added to the language:
Add a Variant variable that can store any other type of value, otherwise you cannot store the value of the Excel table cell in the variable (at least without resorting to Select Case).
Late binding was added (via IDispatch) because the original Silver architecture required a deep understanding of the type system, which Excel macro writers didn't want to know.
Add the For Each construct borrowed from csh.
Add a With... End With construction, borrowed from Pascal.
Joel then sat down and wrote a specification for the future language, Excel Basic, about 500 pages long, which he sent to Bill Gates for review/verification
Twinbasic gives us a lot of imagination for a similar successor to VB6, and the company's development capabilities are so strong that if it had started 20 years ago, it would have captivated developers around the world like PYTHON did.
Maybe it will become a public company, maybe it will become a great software product like DELPHI or VSCODE.
Because the IDE does not provide these interfaces, or because some of the information is intentionally not public, we have the option of using assembly code to read some unknown memory.
Unless the IDE provides a development interface such as add in, there is also an SDK API that allows us to participate in adding functionality to the IDE.
That's the idea behind turning VB into .NET.
The bottom line is tB is not meant to be another .NET. There's not going to be a framework wrapping the entire Win32 API in safe pointer using classes or wholesale replacing it. Fans of the .NET approach can lament that all they want, but it's simply not a good argument to say "Well, if tB was a .NET clone, low level feature x wouldn't be needed, therefore it's not needed." which seems to be what you're getting at here.
But I have a question, and it may not be about that. But I don't want to put it in a separate topic. Plus, there are a lot of smart minds out there. :D
A lot of good programmers on the forums really like VB6 and would like to see MS develop it further - such as VBx64. But, my friends, what is stopping you from making this idea happen on your own? Some of the code has been implemented by MS itself in VBA for x64 MS Office. I know it won't be easy, but, as they say, "The road will overcome the walker." A good example is the hobbyist QB64. Sadly QB64 is not as good as VB, but it does support 64-bit, a lot!
Do you think you can handle such a project?
Kind of but I'm actually not so much thinking of specific languages but I'm getting at something more intangible and fundamental about language design. It's very clear in my mind but extremely difficulty to describe to someone else. Let me see if I can add a bit of clarity. Consider the following VB6 code:-
That code has a bug in it that's easy to miss. If you ran that a hundred times, it will bomb out with a "subscript out of range" error every time. Run it a billion times, it crashes every single time. If the above code is on a hot-path, it's practically guaranteed that you will never ship production code with that bug in it because the runtime would have alerted you to the bug long before it's ready to ship. Now consider the same thing written in C:-Code:Dim sigature() As Byte
ReDim signature(0 To 1)
signature(0) = 119
signature(1) = 116
signature(2) = 102
In C, arrays are just another way of using pointers. It's a more friendly syntax in certain situations but it doesn't change the fact that writing to an invalid pointer cannot be meaningfully defined. What this means is you could run that code 100 times or a billion times and nothing happens but on the 101st or billionth + 1 run, it bombs with an access violation error, but even the type of error isn't guaranteed. Even if this code is in a hot path, you could still end up shipping the software with this bug because you were never altered to it during development.Code:
uint8_t *signature = (uint8_t*)malloc(2 * sizeof(uint8_t)); // bug: should be 3
signature[0] = 119;
signature[1] = 116;
signature[2] = 102; // bug: writing past the end of allocated memory
}
You see when I think of BASIC, whether it's VB6, VB.Net or TwinBASIC, I think of the language itself as a contract between creators of the language and the developers using it. The language devs are saying to us, the users of the language "Hey, if you use our language, we guarantee you that no features in this language will produce undefined behaviors but if you go outside of that, do so at your own risk. We make no guarantees then". We have to opt-in to writing unsafe code ourselves. If we avoid VarPtr and all that comes with it, the language guarantees that nothing we could do would ever have an undefined outcome. This has always been the contract between the language of BASIC and the developers using it. Introducing first class pointers would change this age old unspoken contract and I can imagine it upsetting a lot of BASIC purists. This is really about the very identity of BASIC here.
Now personally, I have no problems with first class pointer support in a BASIC variant for all the reasons fafalone stated, I think it's a great idea. Objectively speaking however, even I recognize this changes something very fundamental about the BASIC language and it tickles me somewhere deep in my soul. I doubt we have really considered all possible implications of such a drastic change.
That question has been asked roughly every other year since 2002. The rate of asking that question does appear to have diminished somewhat, of late, and that might be because TB is the (or at least an) embodiment of the answer. It can be done, it is being done, it just isn't easy...as 300+ beta releases and counting can attest to.
freebasic is qb64?it's support x64,gcc
CommonControls (Replacement of the MS common controls) - Page 87-VBForums
https://www.vbforums.com/showthread....ntrols)/page87
https://www.vbforums.com/showthread....ontrol)/page22
for this,if it's can run no errors in twinbasic,That represents a real success, even converted to 64-bit controls. As far as I know custom controls will be the hardest to import into TWINBASIC from VB6.
But something might be easier than parsing the data in the *.frx file, since all properties of the custom control are read as if it were an INI file. However, the highly complex design method will make it difficult for TWINBASIC to be successfully imported, and perhaps TWinbasic has perfectly realized it.
I used VFB (VISUAL freebasic ide) to load the DLL in the resource file written in VB6 in the memory and call the conversion successfully. It took several hours. It took me half a month to convert to 64-bit later, it was too difficult. Various data type conversions, and unknown errors.
So at that time, it was estimated that it would be difficult to upgrade VB6 to 64-bit. Microsoft spent all its time on wars with JAVA, and VB6 had long been abandoned.
The 64-bit VBA is because it is bound to the paid product OFFICE, cad (vba sdk), so they have upgraded it.