5 ms·
what do you mean by "execute it"? It's source, you need to compile it and get an executable out of it. This is not Python, an interpreter. But if you want an in
by unnouinceput 6y ago
what do you mean by "execute it"? It's source, you need to compile it and get an executable out of it. This is not Python, an interpreter. But if you want an interpreter for C#, nobody's stopping you to write one.
Me, on the other hand, I want Python to become a compiled language. And to those who's going to reply with "PyPy/Cython/Nuitka" I have a question for them: -do show me a .dll from those!
- ninkendo 6y agoTo give an example, in Swift, I can write a hello.swift with: #!/usr/bin/env swift print("Hello") And after a chmod +x, it works. Granted, anyone who I distribute this to will need a swift compiler installed, but that’s to be expected (and similar for Python.) Golang and other “compiled” languages have similar ways of making this work too.
- unnouinceput 6y agoOh, I get it. You mean install some sort of interpreter that is called by the OS for that language. Sorry, I live in real world, where customers don't allow you to install a gazzilion files just to run your application, they expect a proper installer that is under strict supervision by their admin team and you only deliver executables.
- 0xcoffee 6y agoI would love to replace all my powershell build scripts with .cs files. imo there is lots of room for C# Scripts.
- ninkendo 6y agoI don’t think the use case for this is anything you’re shipping to “customers”... more for just personal code you can use as scripts/playgrounds. To use the swift example, often I want to double check whether something in the language works as I expect, so I write a quick test.swift and run it. It’s a useful thing even if you don’t personally want it.
- twodave 6y agoVS comes with an interactive C# window that basically serves this purpose. Aside from that, you can always write a unit test and set a breakpoint to inspect whether something works as you think it does. In my opinion both these options are superior to running a file for that use case (though running a C# file would certainly have other uses that tests/REPL aren't sufficient for).