3 ms·
i want to love dotnet-core, especially since godot switched from mono in godot 3 to dotnet-core in godot 4, but so far i haven't been able to currently debian
by kragen 2y ago
i want to love dotnet-core, especially since godot switched from mono in godot 3 to dotnet-core in godot 4, but so far i haven't been able to
currently debian has a mono package but no dotnet-core package. i'm not sure why this is; usually when debian lacks a popular nominally open-source package like this, it's either because it fails to build from source, or because it has some kind of tricky licensing pitfall that most people haven't noticed, but diligent debian developers have
does anyone know why this problem exists for dotnet-core?
also, does dotnet-core have a reasonable aot story for things like esp32 and ch32v003?
- Goz3rr 2y agoEven with AOT compilation, as someone who loves C# and also does embedded development in C I would personally say a garbage collected language like C# has no place there.
- kragen 2y agonot everything running on a 20-mips 32-bit microcontroller with 2 kibibytes of sram needs to be hard real time and failure-free, and of course the esp32 has hundreds of kibibytes and, correct me if i'm wrong here, but doesn't c# allow you to statically allocate structs just as much as c does? i'd think you'd be able to avoid garbage collection about as much as you want, but i've never written much beyond 'hello, world' in c#
- runevault 2y agoc# has the concept of value types (which structs are), which are stack allocated. Generics have seen more and more instance of getting a Value type like Value Task for stack allocated async objects. But if you add a class as a member of the struct that is going straight to the heap with all the GC stuff that entails
- kragen 2y agowhat about global or static variables of value types? i mean in theory you could stack-allocate whatever you want in your main() method and pass pointers to everything, but that sounds unusably clumsy. but with global variables and/or class variables there would be no problem except for things that inherently require heap allocation by the nature of the problem
- runevault 2y agothere are ways (byref I think?) to pass references to stack variables around. And Statics depends. Static const even with stuff like strings would just compile directly into the binary, regular static still has to end up on the Heap.
- neonsunset 2y agoStatic fields may be placed on Frozen Object Heap. The values of static readonly fields may not exist at all if the ILC's static constructor interpreter can pre-initialize it at compile-time and bake the value into binary or codegen. Tiered Compilation does a similar optimization but for all cases. This is with JIT though which is not usable in such environment. Otherwise, statics are placed in a static values array "rooted" by a respective assembly. I believe each value will be contained by a respective box if it's not an object. This will be usually located in Gen2 GC heap. My memory is a bit hazy on this specific part. There is no concept of globals in .NET the way you describe it - you simply access static properties and fields. In practice, you will not be running .NET on microcontrollers with existing mainline runtime flavours - very different tradeoffs, much like no-std in Rust. As mentioned, there is NanoFramework. Another one is Meadow: https://www.wildernesslabs.co https://www.wildernesslabs.co which my friend is using for an automated lab for his PhD thesis. Last mention goes to https://github.com/bflattened/bflat https://github.com/bflattened/bflat which supports a few interesting targets like UEFI. From the same author there's an example of completely runtime-less C# as well: https://github.com/MichalStrehovsky/zerosharp https://github.com/MichalStrehovsky/zerosharp. It remains a usable language because C# has a large subset of C and features for manual memory management so writing code that completely bypasses allocations is very doable, unlike with other GC-based alternatives.
- fulafel 2y agoGC is fine for many (most?) applications there. For example sensor stuff, display, networking, turning your lights on and off, etc.
- mdasen 2y agoYou can add add Microsoft's repo to install it on Debian: https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian https://learn.microsoft.com/en-us/dotnet/core/install/linux-.... Does Debian require packages to work on all of its architectures? If so, that could be the issue. .NET Core only supports x86, x64, and Arm64 (I think Arm32 has been discontinued and RISC-V is experimental at this point). It's possible that they object to .NET Core having certain license restrictions on the Windows port (https://github.com/dotnet/core/blob/main/license-information-windows.md https://github.com/dotnet/core/blob/main/license-information...). .NET Core is mostly MIT or Apache licensed, but the Windows SDK has some additional terms. Skimming the third party licenses, that doesn't seem like an issue (mostly MIT/BSD/Apache or similar). I think the licensing situation is an interesting question: if you have software that's 100% open source when compiled for your OS, but requires non-free stuff to run on Windows, is it ok to include in Debian? It looks like none of the non-free stuff (like WPF) gets distributed with the non-Windows SDK builds. Binaries created from your code only depend on MIT-licensed stuff on macOS and Linux, but might depend on something closed-source when targeting Windows - though it looks like almost all of that stuff is either WPF (so you wouldn't be able to develop on Linux/Mac anyway since those libraries wouldn't be in the SDK on those platforms) or were removed as a runtime dependency in .NET 7. It looks like `Microsoft.DiaSymReader.Native` might be the only thing left. Maybe that's what is holding it back? > also, does dotnet-core have a reasonable aot story for things like esp32 and ch32v003? "Reasonable" can be a lot of things to a lot of different people. People have been working on RISC-V support. Samsung seems interested in it. But I probably wouldn't recommend it at the moment - and Mono doesn't really have RISC-V support either.
- ozim 2y agoI would say it is .Net Foundation job to prepare and submit the package not Debian maintainers.
- kragen 2y agoif you want your package to be in debian, you are going to have to find a debian developer who is willing to take responsibility for maintaining it. microsoft is already providing .deb packages on their website, at least binaries
- davidhyde 2y agoI believe that you would use dotnet nano for something like that. I used it (or some previous version of it) once many years ago and was very impressed with the productivity and ease of use it offered. Ultimately the lack of community surrounding it drove me to other technologies. Might have changed since then though, who knows! https://www.nanoframework.net/ https://www.nanoframework.net/
- MarkSweep 2y ago.NET Core is available for Debian, you just have to add Microsoft's APT source [1]. Fedora [2], Ubuntu [3], and FreeBSD [4] build .NET from source themselves. A lot of work has been done to make it possible to build .NET from source [5] without closed source components, so it might just be a matter of someone being motivated to create the package for Debian. [1]: https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian https://learn.microsoft.com/en-us/dotnet/core/install/linux-... [2]: https://src.fedoraproject.org/rpms/dotnet8.0 https://src.fedoraproject.org/rpms/dotnet8.0 [3]: https://launchpad.net/ubuntu/+source/dotnet8 https://launchpad.net/ubuntu/+source/dotnet8 [4]: https://github.com/freebsd/freebsd-ports/tree/main/lang/dotnet https://github.com/freebsd/freebsd-ports/tree/main/lang/dotn... [5]: https://github.com/dotnet/source-build https://github.com/dotnet/source-build
- kragen 2y agoyes, i know about the microsoft apt source as for building from source, i see, thanks! or maybe it's unresolved legal concerns? nobody so far in this thread has known of any, though
- Mogzol 2y agoI doubt it is due to legal concerns if Ubuntu, Fedora, and FreeBSD are all distributing their own builds.
- kragen 2y agoyou could easily imagine fedora distributing their own build of software whose licensing fails to comply with the debian free software guidelines; bundling proprietary software used to be common in linux distributions in fact
- k_roy 2y ago"legal concerns" is not the same as philosophy differences.
- MarkSweep 2y agoI found someone requesting that it be added to Debian: https://bugs.debian.org/cgi-bin/%3Ca%20href=%22bugreport.cgi?bug=1078132%22%3E1078132%3C/a%3E https://bugs.debian.org/cgi-bin/%3Ca%20href=%22bugreport.cgi... So far no one has mentioned licensing being an issue.