Earlier quoted context omitted.
F# is nice, i like it.
Interesting, I have been skeptical about .net as a platform, is it really open and doesn't lock you with microsoft in any way?
Maybe similar to OpenJDK and Oracle?
91–100 of 107 posts
Earlier quoted context omitted.
F# is nice, i like it.
Interesting, I have been skeptical about .net as a platform, is it really open and doesn't lock you with microsoft in any way?
Maybe similar to OpenJDK and Oracle?
So... the verbosity of Go without the compile speed of Go? Go is not a language I would associate with ergonomics, and this doesn't even have most of modern C#'s best features: does xUnit.NET work? Does immutable records work? Do collection expressions work? Does LINQ work? Calling a language with `let` instead of `const` and async/await and iterators and classes "Go" is plain just incorrect. This G# is more similar…
https://learn.microsoft.com/en-us/dotnet/csharp/language-ref... they're coming
enum Pet {
Cat,
Dog,
Bird
}
var description = Pet switch
{
Dog d => d.Name,
Cat c => c.Name,
Bird b => b.Name,
_ => "no pet"
}
The other issue is they introduced `null` to pattern matching on their union example when the whole point of pattern matching is that you can pretty much mostly remove `null` from the language altogether with Result available, as Rust has shown.Earlier quoted context omitted.
https://learn.microsoft.com/en-us/dotnet/csharp/language-ref... they're coming
Yeah, I still don't understand why they don't just use enums and have to invent a special "union" keyword instead. C#'s enums are extremely underpowered to begin with and the syntax they designed here way more convoluted and uglier to say: enum Pet { Cat, Dog, Bird } var description = Pet switch { Dog d => d.Name, Cat c => c.Name, Bird b => b.Name, _ => "no pet" } The other issue is they introduced `null` to pattern…
The null patterns predate these unions and the relevant section of the documentation is showing that you can use nullable unions, not that you have to or should use them. Other examples also show a fully closed Result type that yeah would be great for projects hoping to eliminate more nullable code.
How is this different than C#? What new concepts does this bring that C# doesn't? 20 years ago there was some momentum behind Visual Basic .Net; but the language was so similar to C# that it just wasn't worth using. There was a joke that .Net was a "skinnable language." BTW, there's a whole nitpicky/semantic argument that C# isn't null safe because of the null forgiving operator. That will probably come into play wit…
The momentum behind VB.NET was mainly because most enterprises using VB6 assumed it was the natural replacement.
Earlier quoted context omitted.
What's missing in .NET AOT?
That’s a dishonest question, take any code base >10000 slices, it will not work with aot ootb. Read the docs of what’s missing, if you are honestly interested in what’s missing. https://learn.microsoft.com/en-us/dotnet/core/deploying/nati... Reflection, is one thing. Of course some runtime stuff are missing, but the problem is that no one is using source generators before trying out aot, so as soon you try aot you ju…
Everyone should be exploring source generators already whether or not they expect to try out AOT.
[1] Debugging source generated RegExes is a dream, including being able to breakpoint inside a RegEx in the .g.cs file should you need to trying to get a tricky RegEx right. The code generated by the RegEx Source Generator is incredibly readable and includes great comments that explain what the RegEx does, step by step. Those comments show up as documentation comments on the partial .cs file side once the file is generated and can be used to double check that the RegEx you wrote matches what you expect it to do as you write/update the RegEx and the source gets regenerated (which happens pretty fast).
Earlier quoted context omitted.
Interesting, I have been skeptical about .net as a platform, is it really open and doesn't lock you with microsoft in any way?
.NET is Open Source (MIT) but Microsoft is a major - it's probably safe to say the largest - contributor. Maybe similar to OpenJDK and Oracle?
Earlier quoted context omitted.
I don't find Go especially verbose - in fact, due to the economy of syntax, Go code without the usual syntax sugar features ends up similar in length to other curly brace languages. I tested this with C# and Typescript, where I migrated projects from these languages to Go - the overall volume of code stayed roughly the same.
err := do_something() if (err != nil) { return nil, err } err = do_something_else() if (err != nil) { return nil, err } err = do_something_more() if (err != nil) { return nil, err } ... So very concise. And this is not even including the error wrapping that is recommended.
if err := do_something() ;err != nil {
return nil, err
}
Not horrible imo. But I've found that verbose error handling and explicit errors made me consider which parts of the code can return err, and reorganize code around that - with that I've been able to eliminate most 'err' from my codebase.Like, if you go by function: ReadData(has err)-> ParseData(has err) -> ProcessData(no err)
Instead of having functions that can fail dynamically all over your codebase.
Earlier quoted context omitted.
It's a product of an era of OOP when the idea of a program fitting in a developers head was a dangerous reactionary idea. They have in fairness fixed a lot of the worst aspects of this by adding basically a second language to it but e.g. I massively prefer writing F# if purely because if I want to do something I can just to it rather than first implementing public static DoThing : IDoThing
public static DoThing : IDoThing Yeah... Right. In other words, C# is a bad language because you don't like it? What does prevent you from "just do it" in C# without extra classes and interfaces?
- stupid question: how do you make a programming language like this from scratch? - what is the thought process that goes into making a programming language - what is this field of study or discipline called? - why do we have so many programming languages? what purpose do they intend to solve and how do we know what purpose a programming language was made for? - for example, why was swift made if objective c exists a…
the hardest part was what came next: the code generation. despite producing c# instead of MSIL. The features I use are: static and dynamic traits, pattern matching, and a concurrentML.
It is actually quite simple when you don't have to do closure conversion yourself.
for i in 1 ... 5 { sum = sum + i } Means "for 1 to 4". Kill me now.
if a ranges are inclusive, you get used to it. if it is arbitrary it is awful.