Slashdot Mirror


Microsoft Roslyn: Reinventing the Compiler As We Know It

snydeq writes "Fatal Exception's Neil McAllister sees Microsoft's Project Roslyn potentially reinventing how we view compilers and compiled languages. 'Roslyn is a complete reengineering of Microsoft's .NET compiler toolchain in a new way, such that each phase of the code compilation process is exposed as a service that can be consumed by other applications,' McAllister writes. 'The most obvious advantage of this kind of "deconstructed" compiler is that it allows the entire compile-execute process to be invoked from within .NET applications. With the Roslyn technology, C# may still be a compiled language, but it effectively gains all the flexibility and expressiveness that dynamic languages such as Python and Ruby have to offer.'"

195 comments

  1. security? by Anonymous Coward · · Score: 0

    doesn't this allow for malicious programs to get even more malicious?

    1. Re:security? by ackthpt · · Score: 1

      doesn't this allow for malicious programs to get even more malicious?

      If some weasel can figure a way to insert malicious code between Source and Executable, there's always the possibility (and always has been.)

      --

      A feeling of having made the same mistake before: Deja Foobar
    2. Re:security? by Eponymous+Coward · · Score: 1

      Isn't the point of having the compiler as a service so that your executable can feed source code to a compiler?

    3. Re:security? by luder · · Score: 1

      It allows for something similar to eval in .NET. From the article:

      "Hejlsberg demonstrated a C# program that passed a few code snippets to the C# compiler as strings; the compiler returned the resulting IL assembly code as an object, which was then passed to the Common Language Runtime (CLR) for execution. Voilà! With Roslyn, C# gains a dynamic language's ability to generate and invoke code at runtime.

      Put that same code into a loop that accepts input from the user, and you've created a fully interactive read-eval-print loop (REPL) console for C#, allowing you to manipulate and experiment with .Net APIs and objects in real time."

      If your program is doing what the demo code does, then sure, you're asking for code injection attacks.

    4. Re:security? by ByOhTek · · Score: 1

      They may not necessarily mean 'service' as runtime service (the Windows world equivalent of a Daemon), but rather more a sense of a software library (provides a service to other applications, without actually being standalone itself).

      In this case, it's not much different from python/ruby on any system. I could execute arbitrary python code from a C executable without much difficulty. That doesn't mean that there is a problem with how, C, Python or the underlying OS is written.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    5. Re:security? by ByOhTek · · Score: 2

      char *src = /*...*/;
      FILE *fp = open("myfile.c", "w");
      fwrite(src, strlen(src), 1, fp);
      fclose(fp);
      fp = popen("gcc myfile.c", "r");
      fclose(fp);

      Filling in a few blanks and tweaks, that can be done on ANY unix system. It allows ANY software to feed source code to a compiler. Nobody has complained of this as a security risk before.

      Now, it might be a *slight* security risk if it is running as a background process that is always on, and therefore corrupting it once could potentially corrupt all future output, but I doubt MS means it as that type of service. As long as it doesn't run in that method, it's no worse than having the GCC binary callable as I showed above.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    6. Re:security? by ByOhTek · · Score: 1

      Consider cases like the console interpreter for Python or Perl, you could do malicious things with them, but I wouldn't call them code injection attacks. Mind you, using a REPL in a more complex piece of code that has other functions is probably a bad idea, but I think the REPL is more of an easy demo to show what it can do, not the intended use.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    7. Re:security? by Cassini2 · · Score: 2

      This is the reason why gcc (or any other compiler) should never be installed on any production Linux machine.

      Having a compiler installed permits the add-hoc creation of code, with all the resultant security risks. Self-modifying code, including compiled self-modifying code, is an elegant solution in certain environments, however it is a huge security and reliability risk in any production application.

      The problem with the Windows NT 4.0 security model was that security was present almost everywhere, except if an application could be tricked into loading a DLL which then permitted uncontrolled code execution. Microsoft developed Internet Explorer and Active/X, and Microsoft Windows platform security has been weak every since. If you want a secure system, it is necessary to block all methods of running unapproved and unverified code.

    8. Re:security? by Bill,+Shooter+of+Bul · · Score: 1

      But this feature will be encouraging developers to write applications that accept source at run time. If you don't write that into your app, you only have to protect it from malicious code before compilation, in most cases. Which is much, much easier.

      Of course there are always other security threats after compilation as well, and those will still be there in addition to the ones this opens up.

      --
      Well.. maybe. Or Maybe not. But Definitely not sort of.
    9. Re:security? by luder · · Score: 1

      Yes, that's true. When I talked about injection attacks I was thinking more about using this to run JSON-like strings of code when you don't trust the source.

    10. Re:security? by ByOhTek · · Score: 1

      This is the reason why gcc (or any other compiler) should never be installed on any production Linux machine.

      Having a compiler installed permits the add-hoc creation of code, with all the resultant security risks. Self-modifying code, including compiled self-modifying code, is an elegant solution in certain environments, however it is a huge security and reliability risk in any production application.

      By that logic, Python, PHP, Perl and any other scripting language that can popen() or eval() should not be allowed on a production server as well.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    11. Re:security? by Joce640k · · Score: 1

      Yeah, you could write a C++ compiler in PHP and use that instead of gcc.

      --
      No sig today...
    12. Re:security? by ByOhTek · · Score: 1

      I'm simply talking about popen() and exec() like features. Loading of dynamic libraries, etc.

      You can have pretty much the same effect without having to resort to native compiled code.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    13. Re:security? by HermMunster · · Score: 1

      It is not possible to reinvent. That's an oxymoron. They are simply building upon what they and others have developed. Radical technology change, yes, but you can't reinvent anything, especially a compiler.

      --
      You can lead a man with reason but you can't make him think.
    14. Re:security? by HermMunster · · Score: 1

      Bogus response. Compilers are on programmer's computers and they are used in production and suffer the same potential as you describe.

      --
      You can lead a man with reason but you can't make him think.
    15. Re:security? by spongman · · Score: 1

      Having a compiler installed permits the add-hoc creation of code

      wait, if gcc is a security risk, then so is chmod + (any program capable of writing binary data to a file). the only 'vulnerability' that gcc exposes is the ability to create cross-architecture exploits.

    16. Re:security? by terjeber · · Score: 1

      .NET has had "something similar to eval" for a long time. You can easily compile C# code and instantiate the compiled objects today. This is quite different.

    17. Re:security? by exomondo · · Score: 1

      This is the reason why gcc (or any other compiler) should never be installed on any production Linux machine.

      So anything that uses JIT is out then?

  2. 3 years ago by ZeroExistenZ · · Score: 1

    What do they exactly mean by "flexibility and expressiveness of other dynamic languages" ?

    I remember a demo at a Microsoft Developer congress where C# would be able to execute and rebuilt itself dynamically.

    At the time it got me really excited (as I've bumped into many problem which would have a much more beautiful solution should I be able to compile during runtime.) but this seems yet another technology?

    --
    I think we can keep recursing like this until someone returns 1
    1. Re:3 years ago by Dexter+Herbivore · · Score: 2

      I'm wondering if my programming skills have fallen away so much through lack of use that I don't understand this as well anymore, or if the summary/article is just full of buzzwords and impressive sounding jargon.

    2. Re:3 years ago by ackthpt · · Score: 2

      What do they exactly mean by "flexibility and expressiveness of other dynamic languages" ?

      I remember a demo at a Microsoft Developer congress where C# would be able to execute and rebuilt itself dynamically.

      At the time it got me really excited (as I've bumped into many problem which would have a much more beautiful solution should I be able to compile during runtime.) but this seems yet another technology?

      I don't think of it as a new technology, but Microsoft is finally getting around to it. They are such a big dog now that some people don't recognize change until Microsoft rolls it out - years after others have already been mucking about in it for years.

      If they roll it out in a good package, that's a good thing. If they price it above most developers budgets than they're going to be bypassed.

      --

      A feeling of having made the same mistake before: Deja Foobar
    3. Re:3 years ago by Aladrin · · Score: 1

      In the past, you could compile C# source code at runtime and load it into memory and use it. (I know, I was doing it for a MUD that didn't pan out.) But it wasn't very dynamic. (We were using it to reload the code without restarting the MUD.)

      I assume this news means that you can write code dynamically, without writing it to a text file first.

      --
      "If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
    4. Re:3 years ago by sourcerror · · Score: 4, Insightful

      Tiny C compiler does this for years:
      http://bellard.org/tcc/

      Features

      SMALL! You can compile and execute C code everywhere, for example on rescue disks (about 100KB for x86 TCC executable, including C preprocessor, C compiler, assembler and linker).

      FAST! tcc generates x86 code. No byte code overhead. Compile, assemble and link several times faster than GCC.

      UNLIMITED! Any C dynamic library can be used directly. TCC is heading torward full ISOC99 compliance. TCC can of course compile itself.

      SAFE! tcc includes an optional memory and bound checker. Bound checked code can be mixed freely with standard code.
      Compile and execute C source directly. No linking or assembly necessary. Full C preprocessor and GNU-like assembler included.

      C script supported : just add '#!/usr/local/bin/tcc -run' at the first line of your C source, and execute it directly from the command line.

      With libtcc, you can use TCC as a backend for dynamic code generation.

    5. Re:3 years ago by ByOhTek · · Score: 1

      I think the idea is that it will be easier than the current methods. Also, if I remember correctly from previous articles, there will be more profiling information available to help with optimization tasks.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    6. Re:3 years ago by ByOhTek · · Score: 1

      They'll probably do exactly what they've done with the past 2 or 3 releases of Visual Studio.

      Roll it out, have something that's actually pretty damn good, and as long as you aren't making a commercial product, it is all free (except for a couple reporting tools and their code repository server, the latter of which can easily be replaced with 90% of the features by using Mercurial using VisualHG + TortoiseHG, which are free and better suited for most non-corporate development models anyway).

      Now, if you want to use it commercially, that's $750 or so a seat. For the quality of the software, I think it is worth it, but others may disagree.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    7. Re:3 years ago by Anonymous Coward · · Score: 2, Interesting

      You might want to read this wrt tinycc: http://www.landley.net/code/tinycc/
      Also, no x86-64.

    8. Re:3 years ago by Anonymous Coward · · Score: 0

      If they price it above most developers budgets than they're going to be bypassed.

      Agreed. For only $11,899 you too could own Visual Studio 2010 Ultimate. Either that, or you could pay your rent, buy a nice boat, or a decent car.

    9. Re:3 years ago by Anonymous Coward · · Score: 0

      I suspect it is the latter.

      To be honest, there isn't much difference between compiled and interpreted languages anymore. It used to be speed, but really - nowadays I don't see a big difference in speed between by Python scripts and the C# programs.

      This might have some use but I am not really sure if it is a reinvention of the entire paradigm (Or whatever buzzwords the article uses).

    10. Re:3 years ago by ByOhTek · · Score: 1

      Very few would need more features than the professional version, which is $750 or so a seat from many retailers. Still steep for a lot of users, but unless you are a huge software corporation, Ultimate is overkill.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    11. Re:3 years ago by pclminion · · Score: 1

      You might want to read this wrt tinycc: http://www.landley.net/code/tinycc/

      Jesus. That is the saddest story I've ever read. I want to find that guy and give him a hug.

      That's a pretty good summary of why I never bother contributing to open source any more, even though I have tons of code lying around including cool modifications of some pretty big-name projects. I've been lucky enough to never work with douchebags in the salaried, closed source world. I sure as hell will not suffer it while also not making any money from my efforts.

    12. Re:3 years ago by gbjbaanb · · Score: 1

      yes, but a lot of that was built through the reflection feature of .NET, which in turn makes it very slow and clumsy. Reflection has its uses, but the easiest way to tell is to use the following rule: "if you're using it you're doing things wrong."

    13. Re:3 years ago by Anonymous Coward · · Score: 0

      There are no licensing limitations on using Visual Studio Express or the freely downloadable command line compilers commercially. The limitations are strictly around specific forms of features, like the lack of addins and source control.

    14. Re:3 years ago by Anonymous Coward · · Score: 1

      The C# Compiler has always been free. It's the Visual Studio IDE that's mega-bucks. The C# Compiler is part of the the .NET Framework (not the SDK, which is also) and is shipped on every Windows machine since Windows XP SP2. It's analogous to having the GCC on every Linux install.

      And yes, you can write code dynamically without a text file, the feature is called the Interactive Window and ships with the new Roslyn release. At BUILD Anders Heljsberg demoed it by writing one line of code in the Interactive Window and Roslyn ran it without any thing else. I believe it was a file operation. Here is the video where he talks about Roslyn: http://channel9.msdn.com/events/BUILD/BUILD2011/TOOL-816T

    15. Re:3 years ago by ByOhTek · · Score: 1

      I thought there was a limit of one or two commercial projects from VS Express.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    16. Re:3 years ago by Sique · · Score: 1

      This is what I used (and later programmed myself) about 20 years ago in LPC (Lars Pensjö C, later called Pike).
      It was a command called "lpc", and it just took a piece of code as argument, wrote it into a file, compiled it on the fly and called its main and only method.

      --
      .sig: Sique *sigh*
    17. Re:3 years ago by tixxit · · Score: 1

      It makes little sense, in that the dynamism of dynamic languages have nothing to do with "eval" (how many people write Python programs that write Python programs?). More over, runtime compilation is hardly new. Clojure, for example, is always compiled to bytecode, even at runtime, and is a dynamic language. Scala's REPL is a great example of a statically typed language being dynamically compiled and run. With Scala, you can even easily hook into the compiler tools to create your own interpreter and compile code on the fly and run it. There may be new things in Roslyn (I don't know), but, if so, the summary/article missed them.

    18. Re:3 years ago by Anonymous Coward · · Score: 0

      To be honest, there isn't much difference between compiled and interpreted languages anymore. It used to be speed, but really - nowadays I don't see a big difference in speed between by Python scripts and the C# programs.

      Actually, it's the same difference it's always been. The only real "new thing" in the field is Java-style virtual machines bridging compiled code and an interpreter, but even that goes way back (e.g. P-code).

      The bottom line is that faster machines made the difference between native and interpreted code mostly irrelevant.

    19. Re:3 years ago by Anonymous Coward · · Score: 0

      There are mechanisms for this in current .NET but it's a kind of kludgey and an add on. Also it this a bit of an all or nothing (load, link, compile, run) sort of activity if I remember correctly. I assume based on the article that the new technology embeds these capabilities deeper in the .NET stack and let's the programmer call each piece of the tool chain independently as a service so that you can compile all of your dynamic code at spin up but execute it later or some other thing I haven't thought of.

    20. Re:3 years ago by wootest · · Score: 1

      I'm not about to debate anyone on the Visual Studio segmented pricing, but Anders Hejlsberg has gone on record saying he'd like for Roslyn to be open source, by which he likely means Ms-PL. If they do that, they could indeed close it later, at the cost of an enormous shitstorm. (When Microsoft has stopped providing open source before, they've stopped developing the software (see: Rotor). This is the new version of the C# compiler and its IDE integration so that's not going to happen.)

    21. Re:3 years ago by kcitren · · Score: 1

      Gee, it looks like $3,799.00 to me, must be the font I use. Oh, and that includes: Visual Studio Team Foundation Server, Visual Studio Client, Expression Studio, Office Professional Plus 2010, Project Professional 2010, Visio Premium 2010, Development versions of all Microsoft OS's and applications

    22. Re:3 years ago by Flyerman · · Score: 1

      That price includes an MSDN subscription, no surprise that you're an AC.

    23. Re:3 years ago by davester666 · · Score: 0

      It just sounds like a great way for malware to abuse in new ways to make them harder to track and easier to configure for your system.

      --
      Sleep your way to a whiter smile...date a dentist!
    24. Re:3 years ago by Anonymous Coward · · Score: 0

      Well, Expression trees evolved to a point in .NET 4 where that is feasible, albeit much difficult unless you limit yourself to, well, expressions. As soon as you border on statements it gets weird, but I found I can solve my dynamic problems with mostly only expressions.

      Other than that, you still have CodeDOM and the compiler available if exp trees are not enough.

    25. Re:3 years ago by TheRaven64 · · Score: 1

      Gee, it looks like $3,799.00 to me, must be the font I use

      Or maybe you have an MSDN subscription already? That's the price for renewal, the grandparent's price is the one for a new subscription.

      --
      I am TheRaven on Soylent News
    26. Re:3 years ago by TheRaven64 · · Score: 4, Informative

      LLVM is a better example. It's a set of libraries for generating a code in an intermediate representation, transforming that representation (usually for optimisation, but also for instrumentation and other things) and then emitting it as object code, assembly, or JIT'd executable code in memory. I've written compilers for Smalltalk and for a toy JavaScript-like language using it, and they share the same set of optimisations that I wrote for Objective-C and the same object model. The total amount of Smalltalk-specific code is about 15KLoC (including comments).

      --
      I am TheRaven on Soylent News
    27. Re:3 years ago by Dexter+Herbivore · · Score: 1

      Right, so then my point stands. It's buzzwords and jargon making up the majority of this press release. I'm glad to know that bullshit still baffles brains (written with a grain of salt, and a sad attitude towards what's happening in modern programming).

    28. Re:3 years ago by Fippy+Darkpaw · · Score: 0

      There is no limit to commercial use of Express Editions.

    29. Re:3 years ago by Anonymous Coward · · Score: 0

      It's funny but Microsoft doesn't even use their own code repository server software internally, they use Perforce.

    30. Re:3 years ago by Anonymous Coward · · Score: 0

      What do they exactly mean by "flexibility and expressiveness of other dynamic languages" ?

      Got you to pay attention, didn't it? Mission Accomplished(tm).

    31. Re:3 years ago by Anonymous Coward · · Score: 0

      I've been lucky enough to never work with douchebags in the salaried, closed source world. I sure as hell will not suffer it while also not making any money from my efforts.

      Definitely luck. Wish I had yours!

      The worst of the closed source people are just as bad as the worst of the open source people. The difference is that you get paid to suffer them, and I find that difference is a great consolation at times.

      Still, if you can find an open-source project that has leaders you can get along with, it's at least as good as getting paid, because you get to do what you want, not what the customer is paying for.

    32. Re:3 years ago by Jonner · · Score: 1

      I'm wondering if my programming skills have fallen away so much through lack of use that I don't understand this as well anymore, or if the summary/article is just full of buzzwords and impressive sounding jargon.

      It's entirely the latter. What they're describing is nothing Lisps haven't been doing for decades. Although I don't need to use in my everyday programming, standard Python also exposes APIs for compiling source and manipulating syntax trees.

    33. Re:3 years ago by TheCarp · · Score: 1

      wow that sucks balls.

      If I were him, I would have just given up on them much sooner. I used CVS myself exclusively until recently but, I don't think I ever had the illusions of it being really good or even sufficient for real development (luckily for most of my use cases, cvs is borderline overkill)

      I can't imagine someone using CVS heavily, for any significant period of time, and still believeing it to be the bees knees. Unless you have a top notch CVS admin who swoops in fixes things, and makes the annoying stuff nearly transparent for you, then it shows its age and its bain drammge very quickly. I ended up playing that CVS admin for a while, even got good at it....but doing so disabused me of any delusion of CVS being great.

      Git on the other hand.... I can't imagine anyone using both git and CVS, and not wanting to convert everything to git, once and for all.

      Hell I even want to do it in the few places that I still use CVS, I am tempted to change it, and only don't because they are places where changing it and retraining people would be more work than its worth, since its a case where file moves never happen, and we never have multiple lines of development at the same time. (making it a glorified change tracker, rather than a collaboration tool)

      thats just....lame.

      --
      "I opened my eyes, and everything went dark again"
    34. Re:3 years ago by Anonymous Coward · · Score: 0

      Lisp was there first in many cases, yet to the majority of the programming world, it's just a bunch silly parenthesis (nevermind that semicolons and curly braces everywhere are just as bad if not worse).

    35. Re:3 years ago by ommerson · · Score: 1

      It is no surprise whatsoever. TFS is very much modelled after P4, but P4 is considerably more mature and robust - and it's not even terribly expensive either.

    36. Re:3 years ago by Anonymous Coward · · Score: 0

      You might want to read this wrt tinycc: http://www.landley.net/code/tinycc/
      Also, no x86-64.

      Wait, wait...he FORKED a project because he didn't like the source control software they were using???

      Then he complained when people didn't flock to his superior source control version?

      That dude is a moron, and I don't know why you care. That entire rant was the single most stupid thing I've heard and everyone who read it is now dumber for it. May God have mercy on his soul.

    37. Re:3 years ago by Anonymous Coward · · Score: 0

      heh heh, I happen to know first hand that some individuals and even some entire teams use git and then push to p4.

    38. Re:3 years ago by johanatan · · Score: 1

      I've done the same (about 4 years ago actually) without writing to file first. Just build up a string and let the Microsoft.CSharp.Compiler emit the code.

    39. Re:3 years ago by johanatan · · Score: 1

      I find it hard to believe that a guy with a slashdot id as low as yours has never worked with idiots. You have truly been very lucky!

    40. Re:3 years ago by Aladrin · · Score: 1

      Ah, we didn't try that because we didn't need it. I wasn't 100% sure if it was possible or not. (Plus, I don't remember much about it.)

      Anyhow, since they were so specific about each piece being separate, I'm thinking that things might be a lot more flexible this new way... Maybe not even writing code at all, but just creating it programatically. We'll see.

      --
      "If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
    41. Re:3 years ago by Kaenneth · · Score: 1

      Different groups use different tools, many new projects use TFS features, older ones use an internal tool, I havn't heard of anyone using Perforce, but I havn't been looking particularly.

    42. Re:3 years ago by Anonymous Coward · · Score: 0

      The problem people have with Lisp is not its syntax, but rather the language semantics which combine with it and turn programs into meshes of hilariously unreadable code with hundreds of trailing parentheses. If there was a language that was exactly like C, only redesigned so it used parentheses instead of curly braces, people wouldn't have any problem with it. Not saying they would use it, but they wouldn't hate it.

    43. Re:3 years ago by Anonymous Coward · · Score: 0

      huh?

    44. Re:3 years ago by Jonner · · Score: 1

      Lisp was there first in many cases, yet to the majority of the programming world, it's just a bunch silly parenthesis (nevermind that semicolons and curly braces everywhere are just as bad if not worse).

      I'm fully aware that most programmers are unaware of the significance of Lisp, which is why I also gave mentioned Python, which is far more mainstream. Lisps were only the first to implement the features described in TFA; they've been implemented in many other languages since then.

    45. Re:3 years ago by johanatan · · Score: 1

      Yea, it definitely sounds like they've made improvements overall to the process. I think the most interesting bit is being able to get at compiler metadata (a la LLVM). This should open up so many more meta-programming opportunities (without the performance hit of reflection; i.e., with the perf gains of pre- and even re- compilation).

    46. Re:3 years ago by Nikso · · Score: 1

      Could you link anything about this Smalltalk project of yours, or resources you followed? I had the same Smalltalk/LLVM plan in mind and it would be great to have some hints for where to start.

    47. Re:3 years ago by TheRaven64 · · Score: 2

      The code is here. The AST / back end are in LanguageKit, the Smalltalk front end is in Smalltalk (this also contains a few support things that make OpenStep classes look a bit more like Smalltalk-80 ones). The JavaScript-like language is in EScript, but it may not be working at the moment. It currently requires a trunk build of GNUstep libobjc, but I plan on releasing 1.6 of the runtime Real Soon Now.

      I periodically write things about it on the Étoilé blog. You can also read some slightly out of date slides from a talk I gave about it at FOSDEM in 2009, and some more current ones from ESUG this year. Drop me an email if you've got any more questions.

      --
      I am TheRaven on Soylent News
    48. Re:3 years ago by terjeber · · Score: 1

      years after others have already been mucking about in it for years

      Could you provide an example of that? This is not the ability to compile code at runtime, .NET has had that for years. I have several .NET projects where I generate code on the fly, compile and then run it. Have the same for Java. That is not what Roslyn is.

    49. Re:3 years ago by exomondo · · Score: 1

      Agreed. For only $11,899 you too could own Visual Studio 2010 Ultimate. Either that, or you could pay your rent, buy a nice boat, or a decent car.

      Except, if you read the link you posted, that's for a full MSDN subscription that includes multiple licenses to all their operating systems, all their office applications, virtualization, dynamics, small business, expression suites, all their developer tools, all of their servers (exchange, sharepoint, lync, biztalk, sql, etc...) and a lot of other software, not just VS2010 ultimate.

    50. Re:3 years ago by NoOneInParticular · · Score: 1

      tiny C compiler has been doing this for a while. Give it a string containing the function, and it returns a function pointer. And of course, Lisp had a 'compile' function (taking an S-expression of course) for almost forever.

    51. Re:3 years ago by terjeber · · Score: 1

      I... w.i.l.l... t.r.y ... t.o. ... t.y.p.e ... s.l.o.w.l.y ... s.o ... t.h.a.t ... e.v.e.n ... y.o.u. ... c.a.n. ... u.n.d.e.r.s.t.a.n.d.... (a fuck it, have an adult read it to you instead). Yes, the ability to compile code on the fly from within your program is neat. It has existed, as you point out, in Java (ah, you didn't mention that one), some C environments, Lisp, Perl, Ruby, Javascript (eval) and a number of languages for years and years. That includes the .NET platform. Let me repeat that for you, since you seem not to have understood this. The functionality you describe above has also been available in .NET basically since its inception. Hang on to that little nugget of information. It is vital that you understand it before reading on. In other words, the functionality you describe above has basically "always" been available in .NET.

      So, since Andres is talking about something new to .NET, one can, if not completely brain dead, surmise that it is not the ability to compile and run code on the fly he is talking about in this case. Now you can go read up on Roslyn, something that is quite new in the industry. Trust me. It is.

    52. Re:3 years ago by NoOneInParticular · · Score: 1

      Most of the stuff read in this thread is about code generation. That's trivial. But you're right, I didn't read the article, at the time of my original post. All I know is that Microsoft has a great tradition of providing completely new concepts to the industry, rather than rehashing or buying stuff that innovators have been doing. .NET in particular is completely novel an new and has no resemblance to predecessors, especially not with Java. So please, this Andres dude, what did he propose to be new to .NET that has never been seen before. (You do have Lisp, and SmallTalk (Squeek) to compare to)

    53. Re:3 years ago by terjeber · · Score: 1

      Sigh. You seem to think Lisp did some of this before. Which part? Please be specific. Nobody ever said .NET was anything but a Java copy, which now is a significant improvement on Java, but that is another discussion. But again, you seem to think compiling and instantiating source code from a running program is what is new here. It isn't. You have basically been able to do that in .NET since its inception. Each "layer" of the compilation process as a service on the other hand has not been available. Neither is it in any other language I know of.

      If you know otherwise, can you point me to a Lisp environment that will allow me to input source, and it gives me back the syntax tree for said source? Just the syntax tree, I'm building a Lisp syntax high-lighter and I don't want to parse the source to build the tree.

      Oh, and I want to modify the code generated by the Lisp system before it is executed. Just slightly. From within my program. Can I hook into the generator and modify its behavior?

  3. old news? by Verunks · · Score: 3, Interesting
    1. Re:old news? by wootest · · Score: 1

      That was the announcement of the release. This was the actual release.

  4. The compiler as I know it by dkleinsc · · Score: 1, Insightful

    If I wanted to, I could rig GCC and the like to do that too: That's the wonderful thing about command-line tools and piping, you can munge things together any way you want. And of course you can always tell gcc to stop partway through the compilation if you need assembler code or a parse tree or something. This sort of thing is common in open-source compilers, because they need these features for debugging purposes and have no reason to leave them out of the released version.

    Of course, I probably don't want to include a feature like this dynamic code execution, because if I screw up, it would be a fantastic way to get a machine to execute code that it's not supposed to.

    --
    I am officially gone from /. Long live http://www.soylentnews.com/
    1. Re:The compiler as I know it by Mr.+McGibby · · Score: 1

      Yeah, just try it wtih GCC. Not easy. CLANG on the other hand is looking AWESOME for this sort of thing. Once a libraryized version of CLANG is good, it'll make this sort of thing easy.

      --
      Mad Software: Rantings on Developing So
    2. Re:The compiler as I know it by jader3rd · · Score: 0

      If I wanted to, I could rig GCC and the like to do that too: That's the wonderful thing about command-line tools and piping, you can munge things together any way you want.

      What I find useful about Roslyn is that it'll be running as part of Visual Studio, allowing for extensions access to the sytnax tree. My VS extension no longer needs to make guesses based off of the text in the file. The extension can actually see the structure of the code and make the changes I want it to in the IDE. I don't see how piping in the command line will help with the IDE experience.

    3. Re:The compiler as I know it by wootest · · Score: 1

      The "dynamic code execution" just builds on top of support that's already there. You could build a string of a C# program, feed it to a compiler and run it dynamically previously as well. This just makes the compilation part less of a headache.

      Rigging GCC (other comments have already brought up clang) would maybe be more dangerous because arbitrary C code could do anything. Arbitrary IL code can be hamstrung by some security layers. Of course, the differences between managed and native code pale in comparison to what permissions they are executing with, the robustness of any jailing or sandboxing that might be in place and so on.

      If you worry that people can compile programs into executable code, you're not worrying about the right thing. You could write a C compiler in JavaScript or QBASIC. You should be worrying about what happens when that code executes.

    4. Re:The compiler as I know it by shutdown+-p+now · · Score: 1

      This is about much more than just a way to run the compiler. It exposes all lexer and parser layers, so you can get AST. It also exposes separate stages of semantic analysis of that tree, so you can e.g. get it with type annotations for all nodes (after all type inference and method overload resolution), or metadata specifying which of the three foo's in scope this particular identifier "foo" refers to.

      Basically, it's a toolkit that lets you write software that works with C# or VB code and requires deep understanding of it - think static code verifier, or IDE with code completion and refactoring - while reusing the same infrastructure that is used by the compiler itself.

    5. Re:The compiler as I know it by TheRaven64 · · Score: 2

      Uh, clang is 'libraryized'. The clang binary is a tiny wrapper around the various libraries. It's pretty simple to write a replacement or to embed the libraries in something else. Look at Cling, for example, which implements a C++ REPL system using the libraries, or LLDB, which uses clang to parse [Objective-]C[++] expressions in the debugger.

      If the grandparent thinks any of this is easy with gcc, then he's never tried hacking on gcc - even using it for syntax highlighting is almost impossible because the gcc team intentionally avoids clean layering incase someone uses their code evil proprietary programs.

      --
      I am TheRaven on Soylent News
    6. Re:The compiler as I know it by Ragingguppy · · Score: 1

      I'm just thinking about all the wonderful viruses that could be written with this technology. Cudose to you Microsoft for shooting yourselves in the foot once again.

  5. Never heard of Clang? by gnasher719 · · Score: 4, Informative

    It seems that Neil McAllister has never heard of LLVM and Clang, while Microsoft obviously has.

    1. Re:Never heard of Clang? by Anonymous Coward · · Score: 0

      This was the first I thought of as well.

    2. Re:Never heard of Clang? by bames53 · · Score: 1

      Yeah, LLVM and Clang are designed as libraries to be used by other client programs. One of the main developers actually worked on similar stuff at Microsoft.

      Apple is making use of LLVM and Clang in their IDE for exactly the kinds of things talked about in the article, replacing custom parsers used for syntax highlighting or expression parsing in the debugger.

      This is just the direction compilers are going these days. I wonder if older compilers like GCC will be able to adapt or if they'll just continue being monolithic.

    3. Re:Never heard of Clang? by paugq · · Score: 1

      Apple is making use of LLVM and Clang in their IDE for exactly the kinds of things talked about in the article, replacing custom parsers used for syntax highlighting or expression parsing in the debugger.

      Nokia recently adopted Clang too for Qt Creator:

      http://labs.qt.nokia.com/2011/10/19/qt-creator-and-clang/

    4. Re:Never heard of Clang? by TheRaven64 · · Score: 1

      I wonder if older compilers like GCC will be able to adapt or if they'll just continue being monolithic.

      GCC intentionally resisted clean separation and layering because someone might do something evil like create a GPL'd program that did syntax highlighting and invoke it via a pipe from a proprietary program. As a side effect, this made it impossible to integrate into Free IDEs[1]. In response to LLVM and Clang being vastly better for this kind of thing, the GCC team has finally allowed you to write plugins, but it's a bit late. About the only reason to use GCC these days is if you really need to target one of the obscure architectures that it supports. If you care about performance, EKOPath or Open64 is a lot better. If you care about features and modularity, Clang/LLVM is better (and ENZO is even better, but not Free).

      [1] The biggest difference between the GPL and BSD licensing philosophies: The GPL is intended to make writing proprietary software hard, the BSDL is intended to make writing free software easy.

      --
      I am TheRaven on Soylent News
  6. Interactive Compilation by Toonol · · Score: 1

    That's something that I haven't seen a language really get right since FORTH. I'd love to be able to use C# in a similar way, entering small function definitions from the command line, compiling them as they're entered, interactively testing functions as they're written. It's a great way to speed development.

    1. Re:Interactive Compilation by Forbman · · Score: 1

      Boo (boo.codehaus.org) lets you work this way... It's a Python-esque, type-safe scripting language for .Net...

    2. Re:Interactive Compilation by Anonymous Coward · · Score: 0

      That's something that I haven't seen a language really get right since FORTH. I'd love to be able to use C# in a similar way, entering small function definitions from the command line, compiling them as they're entered, interactively testing functions as they're written. It's a great way to speed development.

      You can do some of that already during development with visual studio. Which is set a break point, break, edit the code, and continue. I do this all the time. Really speeds things up.

    3. Re:Interactive Compilation by Anonymous Coward · · Score: 0

      Look at Factor.

      It has optimizing compiler (written in Factor) as a part of runtime and lets you have FORTH-like development interactivity with static optimizing compiler speeds.

      Really needs more love.

  7. That's great! by Anonymous Coward · · Score: 0

    Oh look, M$ has found a new way to infect windows with viruses.

  8. Great for a tiny minority, meh for everyone else by Raul654 · · Score: 1

    This sounds great if you're doing stuff like autotuning, but for the vast (vast, vast, vast) majority of programmers out there I don't really see how opening up the internals of the compiler is useful. Who cares if that loop gets fused or that function gets unrolled?

    --


    To make laws that man cannot, and will not obey, serves to bring all law into contempt.
    --E.C. Stanton
  9. Hm... by Anonymous Coward · · Score: 0

    This mean that they are taking out the Linker?

  10. Sounds like LLVM by Dwonis · · Score: 2, Informative

    Roslyn is a complete reengineering of Microsoft's .NET compiler toolchain in a new way, such that each phase of the code compilation process is exposed as a service that can be consumed by other applications,

    Sounds like LLVM.

    1. Re:Sounds like LLVM by jader3rd · · Score: 2

      Sounds like LLVM.

      Eric Lippert's responce to that suggestion is "absolutely not". http://blogs.msdn.com/b/ericlippert/archive/2011/10/19/the-roslyn-preview-is-now-available.aspx

    2. Re:Sounds like LLVM by Anonymous Coward · · Score: 0

      "Absolutely not. Low-Level Virtual Machine (LLVM) is a tool that takes code in an intermediate form from the semantic analysis of a compiler, optimizes that intermediate form, and then emits optimized machine code. Roslyn takes in C# and VB source code and produces a lexical, syntactic and semantic analysis of it for you, and then emits the code in an intermediate form. The thing in .NET that most closely resembles LLVM is the jitter. -- Eric"

    3. Re:Sounds like LLVM by Eirenarch · · Score: 1

      Neal McAllister is an idiot of course. Compiling code at runtime is a side effect from this project. The main purpose of the project is that the compiler now exposes its internal parsing/lexing structures as APIs that can be used from IDEs, refactoring tools, etc. By definition they are the most correct and complete which (at least in theory) would lead to great advancement in productivity tools for C# and VB.NET. There is a bonus - a REPL for C#

    4. Re:Sounds like LLVM by Anonymous Coward · · Score: 0

      LLVM mixed with the best of (java) hotspot.

    5. Re:Sounds like LLVM by David+Greene · · Score: 1

      Well, uh, he's wrong. At least if by "LLVM" one means to include Clang, which they usually do.

      --

  11. opengtl, llvm, krita by vurian · · Score: 1, Informative

    Compile and execute code from within an application? That's exactly what Krita (http://www.krita.org) does with OpenGTL (http://opengtl.org) -- we have code written in special languages for filters and so on which gets compiled by Krita and then executed as native code. It's pretty safe as well.

  12. LISP had that 40 years ago by Animats · · Score: 4, Informative

    This isn't exactly new. LISP had it from the early days. It's an idea that's been tried before, now available with more modern buzzwords, like "the compiler as a service".

    .NET as a virtual machine environment has become somewhat pointless, since the Windows/.NET environment is pretty much "write once, run on X86" now. Itanium support was dropped in 2010, and Microsoft's "Windows 8 for ARM" is apparently Metro-only.

    1. Re:LISP had that 40 years ago by Richard_at_work · · Score: 2

      You can develop for Metro in .Net after the last announcement, and it will be supported on ARM.

    2. Re:LISP had that 40 years ago by Sez+Zero · · Score: 1

      "Windows 8 for ARM" is apparently Metro-only.

      I'm not sure why, but that makes me snicker.

      Probably because I'm juvenile.

    3. Re:LISP had that 40 years ago by Anonymous Coward · · Score: 0

      .. a service you have to pay for per compile, per file, per line.

    4. Re:LISP had that 40 years ago by shutdown+-p+now · · Score: 2

      Lisp does not have any syntax to speak of, so you don't need a large framework to do syntactic analysis. And it's dynamically typed, so most semantic analysis is rather pointless.

      What this does is give you a annotated (with types, resolved references etc) code model that you can build upon. It's not at all like, say, CL macros. A different tool for a different job - think static code analysis, advanced refactoring, code-aware search etc.

    5. Re:LISP had that 40 years ago by lucian1900 · · Score: 1

      Even Java has had the compiler available as a library since the beginning. Python has good as tool too, a had for a while. Not revolutionary at all.

    6. Re:LISP had that 40 years ago by afabbro · · Score: 1

      But can I write for Metro in Lisp?

      --
      Advice: on VPS providers
    7. Re:LISP had that 40 years ago by Hentes · · Score: 1

      The difference is that LISP is an interpreted language.

    8. Re:LISP had that 40 years ago by msobkow · · Score: 1

      No matter how many times it's been tried before, it's still a neat idea. It'll be interesting to see where Microsoft takes this idea.

      --
      I do not fail; I succeed at finding out what does not work.
    9. Re:LISP had that 40 years ago by msobkow · · Score: 1

      True AI requires the ability to rewrite the code of the AI system itself, thereby implementing learning algorithms. My own work is primitive compared to a an AI; I've only created an expert system, which is a much simpler thing.

      A true programming AI would be able to extract data structures and algorithms from virtually any language, learn from it, and teach itself to program in those languages, rather than having someone manually teach it by updating the knowledge base.

      --
      I do not fail; I succeed at finding out what does not work.
    10. Re:LISP had that 40 years ago by Anonymous Coward · · Score: 1

      Lisp can be interpreted, compiled or byte compiled or a combination, depending on the platform. Common Lisp has optional typing for profiling and optimization. You can incrementally compile your code as you go.

    11. Re:LISP had that 40 years ago by svick · · Score: 1

      Is IronScheme good enough for you?

      I think you should be able to use any .Net language to write Metro apps. The tooling (like work with XAML) won't be as great as in C# or VB, but it should work.

    12. Re:LISP had that 40 years ago by svick · · Score: 1

      What? This isn't about running the compiler on Microsoft's servers. This is about being able to access compiler's internals.

    13. Re:LISP had that 40 years ago by Anonymous Coward · · Score: 0

      There are three kinds of new innovations in programming languages:

      1. The kind that LISP has already been doing, explicitly, for decades (this, dynamic typing, first-class functions).
      2. The kind that LISP has been implicitly capable of for decades, which can be made explicit in 100 lines or less (object orientation, agile programming).
      3. The kind that are merely kludges thrown together to try to work around limitations in non-LISP languages (object orientation, agile programming).

    14. Re:LISP had that 40 years ago by spongman · · Score: 1

      the java API allows you to access/modify the syntax tree, get data-flow analysis, etc...? or is it just a dumb wrapper around the compiler front-end?

    15. Re:LISP had that 40 years ago by lucian1900 · · Score: 1

      I believe the early Java API is just a compiler front-end. One can script a compiler written in java, however. Python's ast tools are indeed complete.

  13. Sounds cool by GameboyRMH · · Score: 1

    Can't wait to get my hands on a FOSS clone of it.

    --
    "When information is power, privacy is freedom" - Jah-Wren Ryel
    1. Re:Sounds cool by Anonymous Coward · · Score: 0

      Try boo: http://boo.codehaus.org/

      It's being doing this for years.

    2. Re:Sounds cool by Anonymous Coward · · Score: 0

      You mean, the commercial clone of LLVM

    3. Re:Sounds cool by Anonymous Coward · · Score: 0

      You can, 10 years ago.

  14. Malware writers by Anonymous Coward · · Score: 0

    ...and the Malware writer community collectively cried: WOOHOO!!! :-)

  15. Re:security? My first thot, too... by JetScootr · · Score: 1

    Now malware can be shipped in various partially-compiled steps and in different packaging (one,two,three modules, arriving from different vectors, etc), making detection harder, and can then be compiled targetting the cpu it lands on. Oh, what a fricken great IDEA! platform-independence for malware just got easier! It''s really getting hard to distinguish between the bad guys and producers of ideas like this.

    --
    Pavlov wouldn't be so famous if he'd used a can opener instead of a bell.
  16. Scala by robmv · · Score: 1

    like the Scala compiler? an API, plugin support and more? the Scala shell uses it as an example of how to use it

  17. Re:Great for a tiny minority, meh for everyone els by Anonymous Coward · · Score: 0

    Its not so much about seeing what the compiler did, but changing what will do. Roslyn will enable tool writers to parse and analyze programs consistently. This seems most helpful for tools like Resharper and NDepend. I think you could also use it to make AOP possible without an IoC container, i.e., you mutate the compiled partially compiled output to cleanly integrate cross cutting concerns.

  18. Wow, sort of like UNIX command-line utilities by Coop · · Score: 0

    Small modules that can be assembled in different ways to achieve many objectives -- great idea!

    --
    "If you're not passionate about your operating system, you're married to the wrong one."
    1. Re:Wow, sort of like UNIX command-line utilities by Anonymous Coward · · Score: 0

      Yeah, except the unifying layer is a full programming language, not just a bunch of shells executing incompatible scripts.

  19. How is this different from... by Anonymous Coward · · Score: 0

    LISP has been compiled, and has a eval statement.

    SPITBOL is a compiled version of Snobol and supports the Snobol CODE statement which allows one to construct code and invoke it dynamically.

    The Java Compiler can be invoked from within Java.

    Am I missing something?

    1. Re:How is this different from... by Anonymous Coward · · Score: 0

      I don't think you're missing anything, the author is missing something, which is, providing an API so that other programs can use the compiler to parse and analyze code. I use an open source IDE for embedded work and a major problem they have is that the parser they've been using for implementing syntax highlighting, error detection, code completion, navigation etc is a _different piece of software_ than the compiler. Sometimes they don't agree on how code is to be parsed, that leads to crashes and other odd behavior. Allowing the IDE to use the compiler itself to parse the code goes a long way towards solving these issues.

      Me what I really really want is to be able to do just in time compiling on my embedded stuff. In theory there isn't any read reason you can't patch binary code dynamically, it's just that the moldy tool chains weren't designed for it. (Way back in the day I used to see assembly language guys do this)

  20. Re:security? My first thot, too... by ozmanjusri · · Score: 2

    platform-independence for malware just got easier!

    .NET isn't platform-independant, and neither will this be.

    --
    "I've got more toys than Teruhisa Kitahara."
  21. Common Lisp, 1956 by Anonymous Coward · · Score: 1, Insightful

    If I get a dime for each time someone "reinvents" Common Lisp, I would be rich.

    Please continue innovating, Microsoft. Hint: I think whoever invents the bicycle again, will get to headlines too.

    http://de.wikipedia.org/wiki/Klein_Zaches,_genannt_Zinnober

    1. Re:Common Lisp, 1956 by Anonymous Coward · · Score: 0

      Lisp had a C# compiler? Wow

    2. Re:Common Lisp, 1956 by Anonymous Coward · · Score: 0

      Exactly his point.

      Dipshits like you thinking only in implementations instead of ideas.

  22. That's fine, but can it answer this question... by Anonymous Coward · · Score: 0

    "Rosalyn, who's your daddy?"

  23. Parse tree, AST, symbol tables by oldhack · · Score: 1

    Progressive compilation that allows access to parse tree, AST, symbol tables, and other such artifacts is a great help in IDE and other "introspective" applications.

    --
    Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
  24. big difference by Anonymous Coward · · Score: 0

    Microsoft has patents to this. only joking

  25. Re:security? My first thot, too... by JetScootr · · Score: 1

    I was thinking cpu-specific, not OS-independent. Sorry for ambiguity. CPU-specific compilation may allow for use of idiosyncratic features/bugs in the production of invasive code, something a little more difficult if the target hardware is unknown.

    --
    Pavlov wouldn't be so famous if he'd used a can opener instead of a bell.
  26. LISP? by Anonymous Coward · · Score: 0

    So, they're reinventing LISP?

  27. Compiled vs. Dynamic? by DragonWriter · · Score: 1

    With the Roslyn technology, C# may still be a compiled language, but it effectively gains all the flexibility and expressiveness that dynamic languages such as Python and Ruby have to offer.

    C#, Ruby, and Python are all (in their main implementations) compiled languages. Where they differ is that C# is mostly-statically-typed, and Ruby and Python are dynamically-typed. The .NET compiler toolchain being exposed as a runtime service doesn't really make C# much more like Ruby or Python, since it doesn't change their main area of difference between the languages. It does mean that you can implement the equivalent of eval for .NET languages that don't already have it (like C#), which makes it a little bit more like Ruby or Python, but I don't think "C# doesn't have eval" is really the main reason people would think Ruby or Python is better for certain tasks than C#.

    1. Re:Compiled vs. Dynamic? by Xest · · Score: 1

      C# got optional dynamic typing in version 4 with the DLR, although the DLR is really a set of libraries that just helps with building the required expression tree at run time to allow the dynamic behaviour.

      I do somewhat agree though that I don't see how this gives it any more of the benefits of Python and Ruby than it already had.

    2. Re:Compiled vs. Dynamic? by DragonWriter · · Score: 1

      C# got optional dynamic typing in version 4 with the DLR

      Right. That's why I said it was mostly-statically-typed rather than just plain statically-typed.

      Compiler-as-a-service is a nice feature for the .NET runtime (and, as I understand it, this is a .NET runtime feature, not a C# language feature), but the Ruby/Python comparison doesn't really seem to be on-point as to why.

    3. Re:Compiled vs. Dynamic? by Anonymous Coward · · Score: 0

      The denizens of the System.Reflection namespace give C# (and all other .Net languages) the same capability as is described here, and probably with approximately the same performance hit. And it doesn't have to be language specific, since it emits the underlying MSIL, not an uncompiled C# source file. This sounds like more trouble than it's worth.

  28. Re:security? My first thot, too... by ByOhTek · · Score: 1

    Oh?
    I run it on Windows, Linux, FreeBSD and MacOS.

    I run it on x86 and ARM.

    Seems pretty damn independent to me.

    Regarding what the GP stated though, with the right libraries and a little clever coding, a similar independent 'partially compiled' method could be used with C as well. Of course the partial compile of the windows version would have to check for a C compiler, and download/install one if it isn't available. Java and Flash could conceivably be used to do the same. So, it's really not adding a whole lot of new threats to the ecosystem.

    --
    Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
  29. Re:security? What about.... by JetScootr · · Score: 1

    "each phase of the code compilation process is exposed as a service that can be consumed by other applications."
    How bout if the 'other app' is a web browser window? TFA suggests this will be possible with MS's product.

    --
    Pavlov wouldn't be so famous if he'd used a can opener instead of a bell.
  30. forget first-time submitters, warn about shills! by Anonymous Coward · · Score: 0

    I think when a content producer submits their own article, Slashdot ought to flag that fact - just like they do "whoever is a first-time submitter" - have language to that effect:

    "This article was submitted by the same company that originally produced it."

    I also think that a self-submitted article ought to be given the most negative rating possible so it is buried. If it's any good, someone will find it and submit it.

    I also think Slashdot ought to disclose financial relationships, if any, with content producers for article placements. InfoWorld, Computer World, certain book publishers like Packt, etc are over-represented especially considering the quality of their articles is low.

    Where's that survey link again?

  31. Just like what Mono does by ndogg · · Score: 0

    Sounds pretty familiar. Oh, yeah, Mono does this already.

    --
    // file: mice.h
    #include "frickin_lasers.h"
    1. Re:Just like what Mono does by wootest · · Score: 1

      Really? I like the REPL, but I wasn't aware that they had fixed the entanglement issues.

      Thanks to Roslyn being designed explicitly for these kinds of scenarios, it can give you helpful information from nearly every stage of the compilation progress. You can get syntax trees! Not only that, you can feed it an invalid program and you'll get back a syntax tree that says that it's invalid, but knows when it stopped parsing, what kind of token it expected and can be stringified to the exact text you fed it. You can do flow analysis. There's a solidified model for how C# works in a REPL or scripting environment outside of everything-is-in-a-class mode, which admittedly it was never up to Mono to define.

      csharp-repl is a very good REPL and the mcs family (which now seems to be merging into a single compiler) are very good compilers with source readily available, but I think it takes something that's designed from the start for reusability and being a library as much as a tool to get you these things.

    2. Re:Just like what Mono does by ndogg · · Score: 1

      The Csharp REPL is really just an example usage of Mono.CSharp to which I should have linked to instead.

      --
      // file: mice.h
      #include "frickin_lasers.h"
    3. Re:Just like what Mono does by wootest · · Score: 1

      Sure, but I meant the compiler when I said that, which I thought was clear from the third paragraph.

      The Mono C# compiler can't do all this stuff, and that's completely fine because it's almost impossible to do by accident. I don't fault them for not having done it by accident. If anything, they should be commended for being able to whip up the REPL so easily; that shows commitment to solid design principles.

      But that also means that just staying where they are thinking that they have parity, or someone proposing that they should do that, is unfortunate. They demonstrably don't "do this already" and they shouldn't settle for what they've got.

    4. Re:Just like what Mono does by Anonymous Coward · · Score: 0

      Indeed... Mono is where Microsoft got the idea for this. Not bad thing by any means as long as they a) admit it and give credit b) don't fucking patent it like they invented it. With those two provisios.... knock yourself out Microsoft.

  32. Re:security? What about.... by ByOhTek · · Score: 2

    So? my code could be put in an apache module. Use WSGI and it is available in Python. PHP has the ability to do it straight away.

    It's still not adding any vulnerabilities to the ecosystem that haven't existed before. Yes they used it as a demo, but that's probably because it's a quickly visible demo that everyone can easily see what it is doing. Only an idiot would use it like that on a production system, just like only an idiot would use C, PHP or Python to do the same thing, and those have had that feature for almost as long as they've been around.

    --
    Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
  33. EUREKA! by menkhaura · · Score: 1

    They found a way to shove XML into the compiler! Kudos to MS!

    (see sig)

    --
    Stupidity is an equal opportunity striker.
    Fellow slashdotter Bill Dog
    1. Re:EUREKA! by Anonymous Coward · · Score: 0

      Your sig is blank...

    2. Re:EUREKA! by Anonymous Coward · · Score: 0

      There is a page comparing Lisp to XML. So, maybe this is an old hat too :D

    3. Re:EUREKA! by Anonymous Coward · · Score: 0

      I'm not sure you have any clue what you're talking about.. in fact this is one of the most ridiculous comments I've seen in awhile!

  34. It's not a new idea by juancn · · Score: 1

    We used that approach for PBL some years ago. It is wasteful to having to rewrite parsers and lexers for languages to build IDEs, and other tooling.

    For example, code indentation can be done by walking the AST (you need to be careful to preserve hidden tokens, such as comments).

    You can also allow code completion by changing the compiler to accept a "COMPLETION" token in some places in the grammar. Then, from the editor, when someone presses "Ctrl+SPACE" (or whatever) you mark the location in the lexer and send the code to the compiler. When you build the ast, you insert a completion node in the AST, and you have now contextual information about what can go in there and produce a list of potential things that can go in there.

    Also, syntax highlighting can use the lexer for basic coloring and some type information to then add more information (such as what are field, or functions, etc.)

    What's new is exposing these phases in a standardized manner in the language. That's a bold move, since backward compatibility will be tricky to maintain. Maybe they're thinking in finally stabilizing C#.

  35. Re:security? What about.... by wootest · · Score: 1

    There are already APIs to emit IL or to invoke a C# compiler built into .NET and the security systems built into .NET give you a way to prohibit them. There's no additional risk exposed by Roslyn. Rather, it's a way of getting at the juicy knowledge about the code that the compiler builds up before it exits and that libraries have been written to poorly piece together. That's a good idea that I'd like to see accompany more official language compilers, static or not.

  36. Last I checked... by p4nther2004 · · Score: 1

    Ruby and Javascript were interpreted languages. The kicker isn't the eval function, but rather the def/prototype functions. In Ruby, you can instantiate a String object named str, add a method to String, and then immediately call that method on str. Upshot? - Imagine for a moment replacing (or removing) an object's toString method on the fly.

    1. Re:Last I checked... by DragonWriter · · Score: 1

      Ruby and Javascript were interpreted languages.

      Ruby's primary implementation is a bytecode compiler and a runtime VM..

      The kicker isn't the eval function, but rather the def/prototype functions. In Ruby, you can instantiate a String object named str, add a method to String, and then immediately call that method on str.

      That has nothing to do with compiled vs. interpreted, but with the semantics of method call resolution.

  37. Re:Great for a tiny minority, meh for everyone els by Anonymous Coward · · Score: 0

    It's only "meh for everyone else" until the few folks who are interested start building tools that other people can use.

    I'd love to have a toolchain that gave me the option of directly integrating what are now stand-alone tools into my build process. Static analysis tools, syntax checkers, security analysis, and even future tools that nobody has even every thought of creating yet.

  38. Yes folks...the first thought is the "eval" funct. by p4nther2004 · · Score: 1
    But that's NOT the advantage to this.

    Ever used JSP before? You know that JSP pages are compiled (either on the fly or precompiled) and (if you're smart) you stored off the compiled .java files so you can debug when you page goes belly-up.

    (You have to store the pages, because the line numbers match the .java classes, not the JSP pages themselves)

    Now, we're removing the compiling mess, moving it to .NET as a service, and standardizing the calling of compiling those pages.

  39. Managed AST + Managed Compiler == Boo by LordMyren · · Score: 1

    This premise, a managed AST you can manipulate programmatically (a SOM, Source Object Model), plus a managed compiler pipeline to compile, is nothing new. Boo language was doing this on .NET , and I'm sure there are many examples before it: Boo was started in 2003.

  40. The expressiveness of C# by Anonymous Coward · · Score: 0

    "C# may still be a compiled language, but it effectively gains all the flexibility and expressiveness that dynamic languages such as Python and Ruby have to offer".

    And ties you even more effectively into the mothership ..

  41. Gasping for air by sl4shd0rk · · Score: 1

    Seems to me Microsoft is now attempting to do with compilers what they attempted to do with the mobile phone.

    --
    Join the Slashcott! Feb 10 thru Feb 17!
  42. Javassist? by brunes69 · · Score: 1

    How is this any different at all from Javassist?

  43. Sandbox? by istartedi · · Score: 1

    Arbitrary CPU instructions aren't a problem. Arbitrary holding of the CPU and arbitrary API calls are a problem. The OS shouldn't award too big a slice to just any arbitrary sub-process. The parent process should check for unauthorized API calls. Something like this can be sandboxed. The question is, what kind of box are they putting it in?

    Given the current ability of scripts to lock up IE and perform drive-by attacks, I'm not too optimistic about how they've secured it either. I'm just saying that it's not impossible.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  44. Frigging newbies..... by sgt_doom · · Score: 1
  45. Re:Yawn... by SplashMyBandit · · Score: 1

    Ah, you are so right. Shame you'll just get modded down for telling the Truth (shame there are so many folk out there who think Window's desktop dominance means that Windows == computing).

  46. Re:Great for a tiny minority, meh for everyone els by Anonymous Coward · · Score: 0

    THATS WHAT CLANG/LLVM DOES!

  47. Waaaaaaah! by Anonymous Coward · · Score: 0

    Jesus Christ. There are some real dysfunctions pointed out, which is regrettable and may even be enough to effectively kill the project. BUT.

    But ALL THAT WAILING about the choice of version control system. Waaaah! Waaaah! You won't use the version control system I prefer! Yours doesn't work! You suck! Piss off! I can't be bothered accommodating it and learning to use it to best advantage! Never mind that countless projects have used cvs perfectly successfully. Just about ALL open source projects for a long time.

    That shit just turned my stomach. Specifically that shit. Just saying.

    1. Re:Waaaaaaah! by uninformedLuddite · · Score: 1

      It's always good to see someone proud enough to stand up and say "im a cock"

      --
      The new right fascists are bilingual. They speak English and Bullshit.
  48. this facility is available in java from a long tim by Anonymous Coward · · Score: 0

    Janino, javaassist and now jdk has feature like this from long time,
    Caerusone (at code.Google.com/p/caerusone) can be used to extend the idea and use similar facility on even Google app.engine.

  49. License issues will kill this by Anonymous Coward · · Score: 0

    So, if these functions are available to a redistributable program then anyone would be able to distribute a Microsoft compiler pretty much for free. If these functions are not available then it limits your customers to those people willing to buy a $800 compiler.

    1. Re:License issues will kill this by BitZtream · · Score: 1

      The .NET framework includes the C# compiler for free, csc.exe.

      The ability to compile C# code in .NET apps has been available since before 1.0 release. This isn't new, just a different way of doing it.

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
  50. gift culture Lebensraum by epine · · Score: 1

    GCC intentionally resisted clean separation and layering because someone might do something evil like create a GPL'd program that did syntax highlighting and invoke it via a pipe from a proprietary program.

    I've been around a long time, and I've never heard that. It has the kind of plausible ring that usually sends me to Snopes, where two thirds of the time I come away chastised for loaning the idea five seconds of credence.

    What I know about GCC is that it had a rough adolescence and that over-arching design hardly entered into it for long stretches of time.

    and ENZO is even better, but not Free and highly vendor specific

    The GPL is intended to make writing proprietary software hard, the BSDL is intended to make writing free software easy.

    There's some truth to this aphorism. GPL is designed around what Stallman doesn't want people to do. It builds from a negative. Stallman doesn't want others to take away his freedom by building something he can't have.

    I admire what Stallman's dogmatism enabled him to achieve. We're probably better off on both sides of the license fence because of it. At the same time, his repurposing of the word "freedom" is one of the most toxic subversions in the history of language. No, he couldn't just come up with his own word, he had to take someone else's word away. I wonder what Marshall McLuhan could have come up with given the starting point "gift culture Lebensraum".

    I think closer to the truth of the matter is that gcc gained far too many extremely important use cases to start dabbling in architectural modernism. You'll note over the same time period, that Linux remained fairly far to the monolithic end of the spectrum. When a project reaches that scale, specific success factors put the stomp on architectural ideology.

    Futhermore, on the C++ side, the rapid evolution of the C++ language wasn't doing anyone any favours in IDE integration.

    The time is ripe for a new approach. The king is dead. Long live the king.

    1. Re:gift culture Lebensraum by bames53 · · Score: 1

      I've been around a long time, and I've never heard that. It has the kind of plausible ring that usually sends me to Snopes, where two thirds of the time I come away chastised for loaning the idea five seconds of credence.

      http://gcc.gnu.org/ml/gcc/2007-11/msg00193.html

      From: Joe Buck
      To: Emmanuel Fleury
      Cc: gcc at gcc dot gnu dot org
      Date: Wed, 7 Nov 2007 08:41:01 -0800
      Subject: Re: Progress on GCC plugins ?

      On Wed, Nov 07, 2007 at 09:20:21AM +0100, Emmanuel Fleury wrote:
      > Is there any progress in the gcc-plugin project ?

      Non-technical holdups. RMS is worried that this will make it too easy
      to integrate proprietary code directly with GCC.

      If proponents can come up with good arguments about how the plugin
      project can be structured to avoid this risk, that would help.

    2. Re:gift culture Lebensraum by terjeber · · Score: 1

      Futhermore, on the C++ side, the rapid evolution of the C++ language wasn't doing anyone any favours in IDE integration

      Shouldn't the word rapid be in quotes here?

  51. I helped you to correct the headline! by JosefSit · · Score: 1

    Here you go! Microsoft Roslyn: Reinventing The Wheel As We Already Know It

  52. Re:security? What about.... by billcopc · · Score: 1

    Only an idiot would use it like that on a production system

    Would you call a JIT compiler idiotic then ? Because this is exactly how I foresee this stuff being used in enterprise apps, particularly ones that rely heavily on dynamic entities. We could have the app generate code on-the-fly that is then reused as needed, rather than reinterpreted every time with a hundred DB calls and long-winded generic form-generating code.

    --
    -Billco, Fnarg.com
  53. Very old technique. by Anonymous Coward · · Score: 0

    I've worked with FORTRAN 66 programs that could do that - the base program was a configuration processors and would read configuration files - then generate variables (usually just arrays and their sizes) and write them into a fortran main program - then the program would start a chain to the compiler/linker, which would then chain to the compiled program.

    It was a way to get dynamically resized arrays specific to a given data.

    It got easier when the dynamic load functions were added to UNIX (the dlopen/dlsym/dlclose library functions).

  54. Why by Anonymous Coward · · Score: 0

    Would anyone want to make a POS slow language like C# even slower?

  55. Java Already Does This by benhattman · · Score: 1

    I see a lot of other tools that do this, but since C# mostly started off as a ripped off Java, it's also worth pointing out that since Java 1.6, that language also provided public interfaces to compile code at runtime.

    These are nice features. Sometimes, they are even useful (as opposed to just another hammer developers can abuse). But the announcement makes it seem, wrongly, that MSFT is doing something really unique here.

    1. Re:Java Already Does This by sproketboy · · Score: 1

      Exactly. In Java land this meh. Been there - done that. Microsoft has the marketing money to make this sound new and revolutionary. ;)

    2. Re:Java Already Does This by spongman · · Score: 1

      LOL!

      C# Has had the equivalent of javax.tools.JavaCompiler since v1.1, Microsoft.CSharp.Compiler which is little more than a wrapper around the command-line compiler.

      But the .NET framework has also, for a long time, included Reflection.Emit which allows for direct manipulation of CIL bytecode, and System.CodeDom for generating and compiling source code in multiple languages from an abstract representation.

      I wouldn't bother reading about Roslyn, though. It couldn't possibly measure up to anything Java has had for ages now, right?

    3. Re:Java Already Does This by terjeber · · Score: 1

      .NET has always been able to compile and execute code from within a running program as well. That is not what Roslynd is about. You can not do this in Java at the moment. If you can, I would like to know the API that will give me a full syntax tree from a piece of Java code. What format is the syntax tree returned in?

  56. Re:security? What about.... by ByOhTek · · Score: 1

    Please read the previous comments, a JIT compiler is NOT what we are discussing. Those are used to compile static, pre-existing code.

    --
    Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
  57. Re:security? What about.... by ByOhTek · · Score: 1

    Addendum, didn't read your whole comment, still not what we were discussing. We were discussing the use of dynamic code entered by the user making a request via the web, and compiled/executed by the application. Not a specific set of pre-defined templated code that is modified without taking code directly or indirectly from the user.

    --
    Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
  58. Nothing new here for c# by BitZtream · · Score: 1

    C# has always supported compiling additional code at runtime.

    I've had it in projects since the 1.0 release.

    They may be redoing the structure and making it easier to do, but doing it isn't new.

    --
    Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager