flat assembler
Message board for the users of flat assembler.

Index > Heap > C# that doesn't require .Net

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 8885
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
is there a C# syntax programming language that doesn't require .Net framework, but able to compile directly to native application?
Post 26 Dec 2012, 07:03
View user's profile Send private message Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier
Xamarin.com

Don't know about Windows support

farrier

_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 26 Dec 2012, 08:35
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
sleepsleep wrote:
is there a C# syntax programming language that doesn't require .Net framework, but able to compile directly to native application?
fasm macros? Razz
Post 26 Dec 2012, 10:17
View user's profile Send private message Visit poster's website Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 821
Location: Jakarta, Indonesia
TmX
Afaik NO. But then, I guess that's not impossible.
Anyway, it possible to compile Java to native code. No VM. Take a look at GCJ. Unfortunately, it creates huge executables, and it's not actively developped anymore.
Post 26 Dec 2012, 10:59
View user's profile Send private message Reply with quote
Bargest



Joined: 09 Feb 2012
Posts: 79
Location: Russia
Bargest
Quote:
I guess that's not impossible.

Many C# VM implementations support JIT - JustInTime compilation from byte-code to native code. So it is possible.
But do you really want to see the result of compiling such a huge and complex (for machine) thing as C#?Very Happy
Post 26 Dec 2012, 15:40
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
revolution wrote:
sleepsleep wrote:
is there a C# syntax programming language that doesn't require .Net framework, but able to compile directly to native application?
fasm macros? Razz

I'll tip my hat to you if you can come up with something along the lines of delegate (and lambda!) support, and a framework as expressive and natural as LINQ (the operator-chaining version, I'm not so hot on the SQL-like syntax). Not sure I'd want to do assembly that way, though Smile

Anyway, It's kinda hard to do stuff like reflection (the way C# and Java handles it) when compiling statically - and it can be useful to do code emitting (in which case you'll need the compiler bundled). And then there's the thing about one of the really nice things about C# being it's huge library support - even if you could compile just the parts you need (dunno how easy it would be in C# to do partial linking at a more granular level than class level?) you'd end up with bloated executables.

Still, a language similar to C# but with some capabilities removed (including GC, traded for destructors and RAII) could be decent to work in, even without the big standard library. I think somebody (more skilled than me Razz) could come up with a useful mix of C++, C# and Scala features (and without a LOT of features + stdlib from the three!) that could be nice for native programming. I've been meaning to look at Digital Mars' D compiler, but haven't had the time... and you can get a long way with (regulated!) use of C++, especially with the C++11 addons (but I guess it's too little too late).

I don't see a point in compiling *existing* C# applications to native code, though Smile

_________________
Image - carpe noctem
Post 26 Dec 2012, 21:08
View user's profile Send private message Visit poster's website Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 821
Location: Jakarta, Indonesia
TmX
f0dder wrote:
(including GC, traded for destructors and RAII)


D has built-in GC (not sure about the other two).
And there is GDC, if Digital Mars' D compiler is not optimizing enough.
Post 27 Dec 2012, 05:00
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8885
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
thanks for all replies, much appreciate,

i was thinking about revolution macro ideas,
i mean what if,

the code use c# syntax, but the processing link to msvcrt or microsoft equivalent dlls,
but maybe it would be useless to have c# syntax but without c# features, Laughing idk.

what i could foresee here is, if nobody do anything to block this .net framework, the future might be .net application ONLY.

no more others languages because every languages (without modification) can compile directly to .net application.
http://phalanger.codeplex.com/

this framework could kill everything, microsoft ambition is bigger than most people would expect.
Post 27 Dec 2012, 12:24
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
TmX wrote:
f0dder wrote:
(including GC, traded for destructors and RAII)


D has built-in GC (not sure about the other two).
I don't find GC to be much of an advantage - it only helps against memory leaks, it's non-deterministic, it can't be reliably combined with destructors, and it makes people lazy... and, IMHO, introduces bugs because people get used to not having to clean up memory, and thus also forget to clean up other resources.

And with a sufficiently flexible language (*cough* C++ *cough*), you don't really need GC. The the STL containers and smart pointers avoid memory leaks, RAII (which can't be done in your typical GC languages!) avoids resource leaks, and for the specific situations where GC gives you better performance you can do your own allocators. (Yes, there's some stuff about GC in C++11 - it's an abomination to introduce that to the spec.)

Haven't looked at how D handles GC - but I doubt they've solved the fundamental issues (I'd be happy to be proved wrong, though).

[edit]: here's a couple of relevant links. There's also an article that goes in depth with why it's super hard (to the point of being impossible) to mix GC and deterministic destruction, iirc by one of the guys on the C# team), but I can't find it at the moment. Anyway:
http://blogs.msdn.com/b/oldnewthing/archive/2010/08/10/10048150.aspx
http://apenwarr.ca/log/?m=201008

_________________
Image - carpe noctem
Post 27 Dec 2012, 13:15
View user's profile Send private message Visit poster's website Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 821
Location: Jakarta, Indonesia
TmX
f0dder wrote:

Haven't looked at how D handles GC - but I doubt they've solved the fundamental issues (I'd be happy to be proved wrong, though).


Like these?
http://forum.dlang.org/thread/icthpqzrlhmyccqxnskt@forum.dlang.org
http://forum.dlang.org/thread/vmuhaofzkzejckbqqxxy@forum.dlang.org

BTW, if I'm not mistaken, some D users are still complaining that heavy GC usage will cause performance slowdown. Not sure either due to bad GC engine or bad programming practice (or both!)
Post 28 Dec 2012, 10:33
View user's profile Send private message Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
I'm having good success with Ultimate++: http://www.ultimatepp.org/

U++ is a C++ application framework that includes: GUI, SQL, Networking, XML, Reports and other stuff.

Final executables are about 1 megabyte (compiled with VC++) without any required DLLs or VMs.

It has its own NTL the substitutes the STL, being faster, more efficient and with better syntax.

It includes the framework and an IDE with GUI layout designer, icons designer, code completion, documentation.

The library is designed so that you don't need to manually manage memory with pointers. Memory allocation just happens.

U++ gives you the productivity of scripting languages while maintaining C++ power.

It took me 2 days to develop a commercial (U++ has BSD license that allows commercial development) database app with it. This app uses Sqlite database, it exports PDF reports, has a complex grid control with editable cells with complex controls like time edits, calendars, progress bars, etc.

I'm more productive with it than with C#.

You won't miss LINQ that much. With U++ you say things like:
Code:
SQL * Select(NAME, PHONE).From(PHONEBOOK).Where(ID == 10);

while(SQL.Fetch())
grid.Add(sql[0], sql[1]);
    


YES. This is C++ code. With heavy use of operators overloading and templates U++ gives you type-checked SQL commands.
Post 10 Jan 2013, 17:21
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder

Those were decent reads, but still didn't address my concerns, unless I misread. Seems like it's still A Hard Problem(TM) that they're working on. Hope I get some time this weekend to hunt for the article I was thinking of, it was pretty convincing Smile. I wonder if it might have been on Lambda the Ultimate?

OzzY wrote:
It has its own NTL the substitutes the STL, being faster, more efficient and with better syntax.

Wouldn't "faster and more efficient" be an implementation detail, depending on which STL you use? Smile - STL used to be somewhat annoying to use, at least std::algorithm, but with C++11 lambdas things have changed.

OzzY wrote:
The library is designed so that you don't need to manually manage memory with pointers. Memory allocation just happens.

Who does manual memory management with C++ these days, smartpointers and all? Or does U++ do something "even smarter"?

OzzY wrote:
YES. This is C++ code. With heavy use of operators overloading and templates U++ gives you type-checked SQL commands.

Looks decent enough for overloaded C++, but still not quite as elegant as LINQ. The sql[xxx] to get results is ugly compared to named field access - and is this statically type checked? It also look pretty heavily tied against SQL, whereas LINQ is pretty darn general.

I wonder how much of LINQ could be duplicated in C++11, now we have lambdas and a bit of type inference - but AFAIK there's still no anonymous class support, so dunno if projection would be possible.

When in C#, I use LINQ all the time - most of it on collections that aren't tied to SQL. Sure, performance might be better if you handwrite it all (and if you did it in C, or in assembly, or...) - but here's an example adapted from the real world, the 4 lines replaces some 30 lines of obtuse imperative code. The Select part should be the only thing that isn't immediately obvious to anybody - it converts domain objects to viewmodels (MVVM GUI pattern).

Code:
private IList<PostView> convertToViewList(IEnumerable<Post> posts)
{
        var conversion = posts.Select( p => new PostView(p) )
                .OrderBy( p => p.EndDate )
                .ThenBy( p => p.Title.ToLower() );
        return conversion.toList();
}
    
Post 10 Jan 2013, 22:56
View user's profile Send private message Visit poster's website Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
fodder wrote:
Wouldn't "faster and more efficient" be an implementation detail, depending on which STL you use? - STL used to be somewhat annoying to use, at least std::algorithm, but with C++11 lambdas things have changed.


It's faster because of its design. It doesn't use the STL internally. More details here: http://www.ultimatepp.org/srcdoc$Core$NTLvsSTL$en-us.html

And here is a benchmark with popular compilers (since you mention implementations): http://www.ultimatepp.org/www$uppweb$vsstd$en-us.html

Quote:
Who does manual memory management with C++ these days, smartpointers and all? Or does U++ do something "even smarter"?


It uses a Heap Allocator. So, the library manages itself.

fodder wrote:
Looks decent enough for overloaded C++, but still not quite as elegant as LINQ. The sql[xxx] to get results is ugly compared to named field access - and is this statically type checked? It also look pretty heavily tied against SQL, whereas LINQ is pretty darn general.


You can use named fields too. I could use SQL[PHONE] if I wanted. I don't know what you mean by more general.


Also, there's always Qt. It's an awesome framework too. I like it better than C#.
Post 10 Jan 2013, 23:36
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 821
Location: Jakarta, Indonesia
TmX
f0dder wrote:

Those were decent reads, but still didn't address my concerns


Maybe you don't mind explaining "the fundamental issues" a bit more?
I would be love to choose D over C++ or Java, for example, but unfortunately there are still lots of issues that have to be addressed (D folks are still arguing about language design, standard library, etc etc).

Smile
Post 11 Jan 2013, 01:50
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
First: U++ seems like a decent piece of work, and something that a lot of time has been spent on. I'm always a bit weary when people use words like "ultimate", though, and I'm also wary of making "core" code dependant on 3rd party libraries. Please don't think I'm flaming or dismissing U++, many of their points are valid (at least before C++11 Razz), and I'm sure it's a great framework if you don't mind locking your codebase to such.

OzzY wrote:
It's faster because of its design.

In which ways? Because it has better O(whatever) algorithms, or other reasons? I skimmed over some of the documentation, and it mentions STL's copy-constructor requirement. Fair enough, that can impair performance (though for 'really expensive' types, you'd often store smartpointers and thus not have nearly as bad performance hit - though that obviously has implications with regards to locality of reference).

I also see that U++ introduces "pick_" (which is just a #define for const) which is required for "transfer semantics" (you need that for it's Vector class and the speed increase over STL) - didn't read deeply enough to know whether it violates normal C++ semantics, but it does seem slightly fishy... both introducing new containers, and requiring (possibly non-standard) special stuff? Hmm.

Oh, and C++11 finally supports "move semantics" - it's taken far too long to add this, but it should address the extraneous copying around that STL used to do. The "U++ Core vs standard C++ library" benchmark only has GCC, and it's the relatively old 4.1 version. Would be interesting to see them do benchmarks against compilers (and libc++!) with C++11 support. I'm not sure when the benchmark was made (page changelog says " 05/12/2010", but those are ont necessarily related) - but GCC 4.1 is from ~2007, at the time of the change GCC 4.4.4 or 4.4.5 (depending on May vs. December) would have been available... afaik 4.1 had no C++11 support, so this would likely matter a lot wrt. benchmark speed Smile

Btw, I'm not saying the STL is perfect, or the end-all-be-all of things - if you have really tight performance requirements, it's still a good idea to hand-roll code. STL's advantage is having a lot of standard algorithms and containers that can be mixed and matched, being widely available, and having "good enough" performance as long as you know what you're doing.

And then there's the quite obvious thing that C++11 is new, I don't believe any compiler has 100% implementation yet, and if you do C++ you'll likely need to support old platforms without C++11 support - so U++ (or something else) could definitely make sense there Smile

OzzY wrote:
f0dder wrote:
Who does manual memory management with C++ these days, smartpointers and all? Or does U++ do something "even smarter"?
It uses a Heap Allocator. So, the library manages itself.

Ummm... what? Can you explain what you mean by this, or have a link to U++ documentation on it?

OzzY wrote:
You can use named fields too. I could use SQL[PHONE] if I wanted.

I guess those are const or #defines? (Only skimmed the documentation, but there seemed to be macro magic and whatnot...) - either could very easily break, if I have similarly named columns in several tables... LINQ, on the other hand, resolves to actual types, and you just access struct/class members - no clashes there.

Also, what does sql[columnindex] resolve to? A generic variant-style type, or the correct static type for that particular column? Again, with LINQ, you get proper static typing.

OzzY wrote:
I don't know what you mean by more general.

LINQ can be used on SQL databases, XML and Collections by default, same syntax. It's extensible, so I could in theory adapt it to other backends. And because of the way it's architected, it's possible to compile down to an abstract syntax tree, which you could run optimizations on and generate code from...

TmX wrote:
f0dder wrote:
Those were decent reads, but still didn't address my concerns

Maybe you don't mind explaining "the fundamental issues" a bit more?

That's why I want to find that paper Very Happy - it does a much better job than I could hope to. I used to wonder "why can't we have a mix of garbage collection and deterministic destructors", and thought that (with a bunch of restrictions) it would be possible to do. But, at least in the context of languages like Java and C#, it wouldn't really be doable if you want to do any kind of mix of deterministic and GC classes - and you can't really avoid that. The paper points out a lot of issues you might not have thought about - and more than obscure corner cases that you're not likely to run into under normal situations.
Post 11 Jan 2013, 09:09
View user's profile Send private message Visit poster's website Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
Well, virtually all complete C++ frameworks won't use the STL.

If you take for example Qt, it has its own QString, QList, etc.

I'd rather have something practical than be tied to the standard library. I see the standard library as something very basic that's there when you only got the naked compiler.
Post 11 Jan 2013, 18:23
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
OzzY wrote:
Well, virtually all complete C++ frameworks won't use the STL.

If you take for example Qt, it has its own QString, QList, etc.

And for good reasons, I guess - some STL implementations are absolutely hopeless. If you want to be über-portable yet make some performance guarantees, I guess that's what you have to do. Also, frameworks like Qt started many++ moons ago, when everything was a lot more sucky than today.

OzzY wrote:
I'd rather have something practical than be tied to the standard library. I see the standard library as something very basic that's there when you only got the naked compiler.

More or less agree - apart from things that need to be really tight, I wouldn't do C++ GUI without some framework (though if not having to be really tight, I'd probably opt to implement the GUI in C# or something else). And because the C++ standard library is so small, you can't do much without 3rd party libraries or a lot of OS dependant code. Heck, until C++11, even threading wasn't standardized!

Still, I prefer to keep the core parts of my applications in mostly standard C++.

Btw, I downloaded U++ in order to give the benchmark a try, but ugh... seems like it has it's entirely own build system, using different concepts than standard C++... made me very tired very quickly Smile. Might take a look a bit later this weekend and see if I can extract just the parts necessary for building the benchmark.

_________________
Image - carpe noctem
Post 11 Jan 2013, 18:55
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
TmX: I think I found the article I was looking for - here goes. It's a pretty long read, but IMHO worth it Smile - http://blogs.msdn.com/b/brada/archive/2005/02/11/371015.aspx
Post 11 Jan 2013, 20:41
View user's profile Send private message Visit poster's website Reply with quote
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
f0dder wrote:
Btw, I downloaded U++ in order to give the benchmark a try, but ugh... seems like it has it's entirely own build system, using different concepts than standard C++... made me very tired very quickly Smile. Might take a look a bit later this weekend and see if I can extract just the parts necessary for building the benchmark.


The first time you build a project (package as they call it) the entire frameworm is built, but it builds fast because it uses this: http://en.wikipedia.org/wiki/Single_Compilation_Unit

This is managed by the IDE when you enable BLITZ in Debug mode.

It takes me about 1 minute to build the entire library. Compared to a full day that Qt takes, it rocks in my opinion.
Post 13 Jan 2013, 13:49
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1409
Location: Toronto, Canada
AsmGuru62
Build the size of a FULL DAY!
Wow!
Post 13 Jan 2013, 16:03
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.