« first day (3536 days earlier)      last day (244 days later) » 

2:05 AM
Modularization is done, and I've been able to load the interpreter in the same page as WebAssembly .NET Blazor
2
Although the more interesting technical stunt would be to actually compile into a .NET "DLL" and using the same heap as Blazor, it's still worth doing in order to let the interpreter load in a page with other Emscripten code.
 
 
5 hours later…
7:23 AM
@HostileForksaysdonttrustSE It is exacly this attitude that keeps the audience small.
 
8:12 AM
@iArnold I'm on Devuan. I had been on Debian for years and years, but that pesky systemd just p!ssed me off, it was making my hardware boot in more than thirty minutes, where the system V was booting in a few seconds.
 
8:32 AM
Interesting. Had my old macbook setup with ElementaryOS for the kid and it booted sooo slooooww. Luckily there was a patch available so it is acceptable now. (Now I cannot reclaim the macbook to experiment putting Haiku (Beta2) and try this Devuan :-( )
I will have to watch the video about "The trouble with systemd" again.
 
@iArnold It may also keep the audience split, hence efforts would be dispersed, rather than focussed. Note that there are much worse examples.
@iArnold To me, the problem with systemd simply lies in the fact that it is gradually taking away the freedom of choosing the very first program that your operating system runs, that is init .
 
@Pierre I mentioned many times that they should do the design and let the community do the legwork
 
The growth of systemd towards a sort of world domination program (world, in this context, referring to the running system) leaves me quite suspicious, it reminds me too much of Crimosoft way of slowly imposing itself everywhere, back in the 1990s.
@iArnold There's apparently an important difference between «contributors» and the rest of the people. For sure I can accept that, but, as you say, some may leave some responsibilities and tasks to the community: this is what makes an open source hurd of disparate fellows happy, isn't it?
 
8:50 AM
@Pierre Rebol has created some revolutionary open source variants: R3-Alpha is Cast-In-Stone open source. Red is Viewable open source, Contribution-Barely-Appreciated open source and now also Partly open source.
 
@iArnold ;-D You're hard!
 
If you are just a few good men, you will need all the help you can get. Do not chase away contributors.
The world is a tough place, get hard or get hurt.
Dutch people are known for saying things in a direct manner. Not always fun to hear, maybe sometimes stated bit too blunt, also true.
So the true problems with the colored language are not dealt with because of the cocooning of the core-team.
I like Brian's way for he is open and communicates all things on his mind.
 
@iArnold I had a Dutch boss, and yes, the manners were very direct. No fussing around, everything was crystal clear, and the battles were just fair, sometimes homeric, and always resulted by a strong, sincere shake of hands.
@iArnold Yes, I tend to agree. But it is so regrettable that the Rebol (as a whole) community is again not in a common constructive move.
 
9:06 AM
I have contacted Earl about the Rebol github repo key long time ago. Not that I myself wanted it, but to have him consider handing over to the community. He said I needed to go to Carl. So it is cast-in-stone now. Ren-C is called Ren-C now cause Color-lang.org heavily protests against it being called Rebol. With all the issues on Color lang it is useless and this will stay until soon (TM) so be like that a long long time (bignum time) if you ask me.
 
@iArnold "heavily protests against it being called Rebol" => against what being called Rebol: Ren-C? Or Red?
 
Ren-C
 
9:55 AM
@iArnold (sigh...)
 
@Pierre (sigh...)
Well anyway.
 
 
5 hours later…
3:11 PM
@kealist I've successfully loaded libr3.js at the same time as a "Blazor" .NET app in the browser. Given that you can call Blazor from JS and JS from Blazor, this makes it possible to prototype an interface for making Ren-C calls from .NET
Looking at the C# implementation of variadics, it requires all the elements of a variadic "params" to be of the same type.
But I surmise it is possible to make some type which can be constructed from either a string or an integer or what-not. So the "single type" limitation really just means you have to make a container type constructible from the N permissible types.
I gather the more palatable idea would be if Ren-C could be packaged into a ".NET 2.0" or somesuch DLL, which it seems Blazor has a Wasm kernel that it uses to figure out how to run the same kind of DLL that you would run on a native .NET. But I'm not sure if that's possible in the sense that generic C code compiled natively is not covered by that spec.
I know a negligible amount about C#, but I'd guess it's that the "CLR" runtime has a bytecode that was easy enough to run, and that's what it's doing vs. being able to run arbitrary unmanaged x86/x64 code.
I went ahead and patched the changes onto the "old" Ren-C (e.g. prior to stackless, which is now 100 commits ahead). This isn't problematic, as the JavaScript extension is LGPL already.
To use it, in the blazor project's wwwroot/index.html put:
 
3:29 PM
@HostileForksaysdonttrustSE Cool, I didn't get far with playing with Blazor yet. I'm not quite how C# would deal with unmanaged code in wasm. I've only used unmanaged stuff directly in console/desktop based applications. I can do some looking
 
    <script src="https://metaeducation.s3.amazonaws.com/travis-builds/load-r3.js"></script>
    <script>
        Blazor.start({}).then(() => {
            alert("blazor says its loaded!")

            reb.Startup({}).then(() => {
                alert("Rebol says its loaded!")
            })
        });
    </script>
@kealist ^-- that sets it up
 
nice
 
@kealist The question would be if one of these .NET 2.0 DLLs can embed Wasm-built code. I think it wouldn't run a plain compiled x86 code, even though it's loading a "DLL".
 
maybe there is a web only target vs framework/core
@HostileForksaysdonttrustSE I'm in unfamiliar territory to some extent, but does this seem useful? github.com/bytecodealliance/wasmtime
 
@kealist It might be useful for something, e.g. if you wanted to build some kind of universal binary artifact that could run in browsers or on the desktop...probably more viable than trying to run x86 in the browser.
I would imagine that if one prototypes a good interface in C# where you can call reb.Value("add", value, "10") or similar but underneath it's doing it calling out to JavaScript and back in, then some sufficiently-motivated individual could do it staying entirely in Wasm and in the same heap as C# runs in.
 
    public static void Test(params dynamic[] args) {
        foreach (dynamic item in args) {
            if (item is String) {
                Console.WriteLine("String " + (item as String));
            }
            else if (item is int) {
                Console.WriteLine("Integer " + item as int?);
            }
            else {
                Console.WriteLine("(Unknown)");
            }
        }
    }
@kealist ^-- I tried that. I had to add "Microsoft.CSharp" as a "Nuget dependency" to get the as int? to compile, but even though it compiled it did not work (printed a blank line). In Blazor. Console.WriteLine goes to the JS console.
There are two forms of Blazor; I did not know this. The first tutorial I ran used a websocket and was running the C# on the server side. Then I created a new project as Client Blazor". I'm not really sure what the difference in capabilities (if any) really are, in terms of calling out to JS libraries or back in.
But with that I did:
[JSInvokable]
public static void TryMe()
{
    Test("one", 2, "three");
}
And then in the JS: DotNet.invokeMethod('BlazorTestSolution', 'TryMe')
The requirement of dynamic needing Microsoft.CSharp suggests it is probably not the right choice for this, it also didn't seem to work. So probably if you want something that's a String, int, "RebValue" or "RebInstruction" it should be a superclass of just those four that can be constructed from any of them.
It did print out String one, then a blank line, then String three
Just noticed the lack of parenthesization on the as int? case. I guess it precedenced that as ("Integer " + item) as int? (?) Changing it to "Integer " + (item as int?) prints out Integer 2 as expected.
Anyway it looks like all the ingredients are there for making a C# version of the API.
 
4:21 PM
@HostileForksaysdonttrustSE My vague impression from what I've read is server side is better supported than client-side
 
@kealist Server-side runs Microsoft's .NET (not open source yet?) and Client-side runs Mono built to WebAssembly, which lags that. I'm just guessing based on what I've seen that unmanaged code (e.g. C++ or plain C glued together with a managed code interface) would only work server side, and whatever magic lets them run .DLLs in the client (transmitted as raw "octet-stream") only runs .NET virtual machine bytecode ones.
Hybrid DLLs that have some ordinary native code in them, I'm guessing, cannot be run client-side via their Wasm bridge.
 
I think all the .NET stuff modern is open source. .Net Core 2/3 at leats
I am working on WPF applications that are running on .NET Core 3
with Windows desktop runtime
That sounds reasonable about dlls, though if CLR works on webasm, I guess the browser probably wouldn't let you run native unmanaged dlls from it's JS runtime
DLLs in NetCore are just the IL so probably not really the same as DLLs in other languages, even if they have the file extension
What version of NetCore if your blazor project running in, 2?
 
@kealist Whatever the default is. :-)
@kealist This claims to be able to compile C to MSIL: ladsoft.tripod.com/msil_compiler.html
Being able to compile in standard lowest-common-denominator C might be an asset in this respect.
 
@HostileForksaysdonttrustSE Probably depends on what version of VS you are using. If you select properties on the csproj file in VS, it should tell you what the target is
 
"netstandard2.1"
 
4:33 PM
You are probably using VS 2017?
 
2019. But Blazor says the client version with Wasm only goes to 2.1 or something, I think I read that.
 
You have Net Core 3.1 SDK? I can't tell easily if 3.1 supports it, but since Blazor is heavily in development and such, probably have to be on the latest version from my experience with Xamarin
It is in VS 2019 16.6
 
"Blazor implements .NET Standard 2.1, which enables Blazor projects to reference libraries that conform to .NET Standard 2.1 or earlier specifications. "
 
ah
 
4:39 PM
Sorry, I misread netstandard
Lovely because Netstadard 2.1 => Netcore 3.0 which is EOL
 
<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
    <RazorLangVersion>3.0</RazorLangVersion>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="3.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Build" Version="3.2.0" PrivateAssets="all" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="3.2.0" PrivateAssets="all" />
I added Microsoft.CSharp to get dynamic to cast to an int because it wouldn't seem willing to do so otherwise, the rest was default.
 
Cool. I will play with it some tonight, so I don't just make noise here, but I have never used dynamic mostly because it isn't necessary in most C# things, so not sure why the need for it to cast a nullable int
 
@kealist I don't know, but yeah, I think the ball is rolling here...so the question is starting the C# wrapper and what that looks like. As a first cut, treating it as a way of calling the JavaScript is probably fine though maybe one wants to call the Wasm routines more directly (in reb.m, the wasm module, e.g. reb.m._RL_Text()) instead of the wrapped versions in JS (e.g. reb.Text())
Anyway, I just felt like trying something new to break the stackless death march, as mentioned it's 100 commits in and there's still plenty more to do. :-/
This is your domain so I'll let you look at it, just wanted to get it started...wouldn't work at all without the "modularization"
@kealist As I said, probably not the best choice, I just wanted to assure myself that C# had a way to "mix types" in a variadic call, and there's at least one way. Probably not the right choice, but I wanted to see things constructible from strings and integers just to prove the API could have the style it has in C and JS
 
@HostileForksaysdonttrustSE Probably the main design issue I've ever had with C# is something like dynamic, but it may just be adding the nuget package because it was added in 4.5 and requiring at least A version high enough that would have the functionality
 
 
1 hour later…
6:13 PM
So I mentioned a sort of "good news, bad news" aspect of stackless, which is that it turned uncatchable "couldn't fulfill the basic contract of invoking a C function" problems into catchable "malloc() returned NULL" situations... but that Rebol has never really been tested to be robust in out-of-memory scenarios.
 
6:30 PM
I'm trying to fuzz test it a bit, by making memory allocations fail sporadically (after boot is complete). But this raises the issue that even if the interpreter doesn't crash, usermode code isn't set up to run things as transactions; if they get the rug pulled out from under them, there's little guarantee they'll be able to restart safely, because some global variables could be in a middling state.
 
7:08 PM
Among the various things that have to be dealt with when you run out of memory, is things like "don't try to allocate an error object to describe that you are out of memory". :-/
You have to preallocate the error or do something else of that nature...but if you preallocate it, then if you try to poke the size into it then it would overwrite any previous errors you saved which kept the information about how much memory couldn't be obtained.
 
@HostileForksaysdonttrustSE Obviously the solution is to predict and preallocate memory for all errors
 
@kealist Well, it's okay to have any non-out-of-memory-error be supplanted by an out-of-memory error if you run out of memory while trying to raise another error... you just need the out of memory path to not need additional allocations.
Once an out of memory error is released from the system to client code, it could release that error and create another stub to await the next out of memory... hence being able to let each one have an identity and different byte count of whatever data makes out of memory errors unique.
But a problem is that there's other stuff done, like building the little trace stack. So if you want to know where the out of memory occurred you need to preallocate for that too.
I'm just pointing out that these are "theoretical" things that weren't vetted in R3-Alpha.
Or it was assumed that any out of memory request would be a big thing... not a small one... since memory was usually allocated in pool-sized chunks, those are the most likely to fail. Less memory... like that for an error, could come out of an existing pool.
I have a naming convention to make things that potentially return null start with "Try_". So I would call a malloc that could fail something like Try_Alloc_Mem(). Then if there's a version that implicitly errors, I omit the try, e.g. Alloc_Mem()
Things that wouldn't have a return result but can return true or false on whether they had the intended effect are "Did_". e.g. if (Did_Close_File()) {...}
Pushing this convention out lets you more clearly see when you're missing handling for null cases.
Anyway, I'm just doing some fuzz testing now--as I said--telling allocations to fail at random times and see the impediments to graceful recovery.
 
7:50 PM
2
Q: Can Blazor WebAssembly call another WASM module directly?

Bernard DarntonCan Blazor WebAssembly code call functions from another WASM module directly or is a JavaScript bridge required? OpenCV has been built for WASM, as OpenCV.js. Is there a way of exporting the function definitions from the OpenCV WASM implementation and using them directly from the Blazor code? Is...

 
 
3 hours later…
10:40 PM
‌>> foo: func [] [foo]
== make action! [[] [...]]‌

‌>> foo
(i) Info: use WHY for error information
‌** Internal Error: not enough memory
^-- so, there is the first successful error'ing in a wasm build from an infinite recursion. That's without a stack capture, which would need (as I say) a bit of memory set aside ahead of time to put some fragment of the stack into.
So one thing that isn't currently done is that it doesn't try to do a recycle when it hits an out of memory situation before failing, to see if it can get back enough memory to fulfill the request. One thing inhibiting that is that recycling has a queue structure that itself might require allocations.
So you can't use recycling unless it has at least a mode that doesn't use any additional memory beyond some fixed preallocated amount.
 

« first day (3536 days earlier)      last day (244 days later) »