11 ms·
TIO: Try it online
- keganunderwood 9y agoNot a comment about tio but I didn't realize it isn't possible to write a simple hello world in C# dot net core. What a shitty situation. What can we do to make it better? Provide a default csproj file on load? Any better ideas? Microsoft (R) Build Engine version 15.3.117.23532 Copyright (C) Microsoft Corporation. All rights reserved. code.cs(1,22): error CS1022: Type or namespace definition, or end-of-file expected [/home/runner/project/project.csproj] code.cs(1,22): error CS1026: ) expected [/home/runner/project/project.csproj] Build FAILED. code.cs(1,22): error CS1022: Type or namespace definition, or end-of-file expected [/home/runner/project/project.csproj] code.cs(1,22): error CS1026: ) expected [/home/runner/project/project.csproj] 0 Warning(s) 2 Error(s) Time Elapsed 00:00:04.92 No executable found matching command "dotnet-project/bin/Debug/netcoreapp*/project.dll" Real time: 6.033 s User time: 2.973 s Sys. time: 0.442 s CPU share: 56.61 % Exit code: 1
- eterm 9y agoJust filling in some default fields in the tio editor would do. For example pre-fill the header as: using System; using System.IO; and pre-filling Code with namespace example { public class Example { static void Main(){ } } } (But better names, my naming sucks!) That would go a long way, then you could just add "Console.WriteLine("Hello World"); for hello world.
- milesdyson_phd 9y agoYou don't even need the namespace or the usings if you just want to print hello world either.
- solidsnack9000 9y agoWhat does the minimal program actually look like?
- driekwartappel 9y agoThis looks like the minimal: class HelloWorld { static void Main() { System.Console.Write("Hello world!"); } } Try it online: https://tio.run/##Sy7WTc4vSv3/PzknsbhYwSM1Jyc/PL8oJ4WrmktBobgksSQzWaEsPzNFwTcxM09DEygIkgCC4MriktRcPef8vOL8nFS98KLMklQNJbABCuUgExSVNK2BSmu5av//BwA https://tio.run/##Sy7WTc4vSv3/PzknsbhYwSM1Jyc/PL8oJ4WrmktBob...
- fizixer 9y ago> Not a comment about tio but I didn't realize it isn't possible to write a simple hello world in C# dot net core. Not sure why you'd think it's impossible [1]. I even ran it in the TIO C# console and it works. [1] https://rosettacode.org/wiki/Hello_world/Text#C.23 https://rosettacode.org/wiki/Hello_world/Text#C.23
- egor598 9y agoThis works for me in TIO: public class App { public static void Main(string[] args) { System.Console.WriteLine("Hello World"); } }
- pavelbr 9y agoNo issues here: https://tio.run/##Sy7WTc4vSv3/PzknsbhYwbGgoLq4JLEkM1mhLD8zRcE3MTNPQ7M6uLK4JDVXzzk/rzg/J1UvvCizJNUnMy9VQ8kjNScnX0chPL8oJ0VRSdO6tvb/fwA https://tio.run/##Sy7WTc4vSv3/PzknsbhYwbGgoLq4JLEkM1mhLD8zRc...
- razorunreal 9y agoBreaks the back button.
- sbierwagen 9y agoYeah, hijacks left-swipe on mobile safari, too. Annoying!
- limeblack 9y agoIf you are on Chrome right click the back button as a temporary solution.
- wink 9y agoA description would be nice. I tried clojure and it successfully printed when my code was (+ 1 3) but I didn't grasp the input/arguments/etc...
- pavelbr 9y agoInput is StdIn. Arguments are command line arguments. Header and Footer are glued to code by newlines. Output is StdOut, Debug is StdErr and timing information.
- olalonde 9y agoReally cool. Would be great if each language had an "hello world" example which would populate the fields.
- runeks 9y agoGreat idea! For Haskell: https://tio.run/#%23y0gszk7Nyfn/PzcxM0/BVqGgtCS4pMgnT0HJAyicr1CeX5STovT/PwA https://tio.run/#%23y0gszk7Nyfn/PzcxM0/BVqGgtCS4pMgnT0HJAyic...
- gluczywo 9y agoFor Go: https://tio.run/##S8//X5CYnJ2YnqqQm5iZx5WZW5BfVKKglJZbovQ/rTQvGSysoalQzcUJFNMLKMrMK8nJ01DySM3JyVcIzy/KSVHS5Kr9/x8A https://tio.run/##S8//X5CYnJ2YnqqQm5iZx5WZW5BfVKKglJZbovQ/rT... BTW Do we really need ~540 bits (~90 chars of base62) to identify permanent link?
- DiThi 9y agoLooks like it encodes the whole code instead of storing it somewhere, so yes.
- deleted 9y ago[deleted]
- potatoasdsadsad 9y agoWell in TIO 2.0 that is coming soon it will not be that long.
- pavelbr 9y agoThere already is a collection of `Hello, World!`s for every language used in tests, and this feature is planned to be implemented soon.
- gus_massa 9y agoI agree. In the standard Racket IDE you get automatically the initial #lang racket line, and in some variants for students the equivalent line is hidden. So I had to try a few times until I realized I forgot to add this line. https://tio.run/##K0pMzk4t@a@ck5iXrlAE4Sh5pObk5CuE5xelKP3/DwA https://tio.run/##K0pMzk4t@a@ck5iXrlAE4Sh5pObk5CuE5xelKP3/Dw... Another improvement could be to show the debug output automatically. I didn't understand the problem until I read the error message.
- sbierwagen 9y agoLooks like http://repl.it/ http://repl.it/ but with more languages.
- agumonkey 9y agoand less "repl"
- amasad 9y agoTIO looks great. However, it's probably serving different purposes than Repl.it, here are some differences as I see them: - repl.it is interactive, which means that not only a process and a container is booted up that stays with you the whole session time but also means that the program state is saved when you're executing code from the repl console. This enabled interactive games like text games and cli programs. - support for multiple file with realtime file update. You can plot something for example: https://repl.it/site/blog/file-updates https://repl.it/site/blog/file-updates - support for third party modules starting with pipy and npm (you can import any module from those registries). There are many other small features that's worth checking out. But to sum up, Repl.it is not just trying to be a code execution service but an actual programming environment.
- lucb1e 9y agoRepl.it sounded really epic... except it's not REPL, at least not for the first language that I wanted to repl: C (https://repl.it/languages/c https://repl.it/languages/c). Still, I like the website better than TIO. At TIO I picked PHP to test and it gives me options like headers, options (without a list of options/settings to modify, just an "Add" button)... I just want to type code in an editor and run it. Repl.it also has syntax highlighting. (For those who don't know, REPL is read-evaluate-print-loop, so it takes an input (e.g. "int i = 0;"), evaluates it (runs it), prints any output, and loops back to the start.)
- sbierwagen 9y agoUsually when I go to repl.it it's to do something in a python console if I'm at a computer that doesn't have python installed: https://repl.it/languages/python https://repl.it/languages/python
- lai 9y agoThis looks cool, but can you guys fix your push state code, I can't hit back to come back to HN.
- dookahku 9y agoconfirmed. Chrome 59.0.3071.115 on Mac back button is broken. cool site, tho
- isatty 9y agoconfirmed, safari Version 10.1.1 (12603.2.4) macOS
- teekert 9y agoYes, same here, FF 54.01 (64 bit) on Arch Linux.
- PhasmaFelis 9y agoDouble-tapping back sometimes works on sites where the landing page immediately forwards you to something else, but this site appears to actively hijack the back/forward buttons. For shame.
- zepolen 9y agocat /etc/passwd root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/sbin/nologin operator:x:11:0:operator:/root:/sbin/nologin games:x:12:100:games:/usr/games:/sbin/nologin ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin nobody:x:99:99:Nobody:/:/sbin/nologin systemd-timesync:x:999:998:systemd Time Synchronization:/:/sbin/nologin systemd-network:x:192:192:systemd Network Management:/:/sbin/nologin systemd-resolve:x:193:193:systemd Resolver:/:/sbin/nologin dbus:x:81:81:System message bus:/:/sbin/nologin polkitd:x:998:997:User for polkitd:/:/sbin/nologin rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin abrt:x:173:173::/etc/abrt:/sbin/nologin sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin cockpit-ws:x:997:995:User for cockpit-ws:/:/sbin/nologin rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/sbin/nologin chrony:x:996:994::/var/lib/chrony:/sbin/nologin tcpdump:x:72:72::/:/sbin/nologin systemd-coredump:x:993:993:systemd Core Dumper:/:/sbin/nologin apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin epmd:x:992:991:Erlang Port Mapper Daemon:/dev/null:/sbin/nologin runner:x:1000:1000::/home/runner:/bin/bash tio:x:1001:1001::/home/tio:/bin/bash
- dTal 9y agoIt has Bash - no need for Python subprocess shenanigans.
- chriscappuccio 9y agotee hee hee
- cabaalis 9y agoJust a comment overall, I bookmarked the site and think it's great. Is it a good idea to present a site that compiles and runs code on a remote server to a site dedicated to hackers? :)
- gluczywo 9y ago
- eridius 9y agoLooks neat, but the code editor really needs syntax highlighting and intelligent indentation.
- KeyboardFire 9y agoIt's not meant to be an editor. That sounds like unnecessary feature creep - the point is to run snippets of code in different languages through your web browser, not to be an IDE.
- eridius 9y agoBut people still need to type those snippets. Typing up fresh code in online code runners (as opposed to pasting in pre-written code) is extremely common.
- skinnymuch 9y agoI think syntax highlighting makes sense. People do write code right into things like this. In that case, syntax highlighting helps if that's what you're used to. Also it is helpful even if copy pasting for readability if you're normally used to syntax highlighting.
- upgoat 9y ago(Disclaimer: client is by me) but I have an alternative front-end for TIO which supports syntax highlighting and indentation for popular languages: https://vihan.org/p/tio https://vihan.org/p/tio
- pepijndevos 9y agoWould be nice to support Piet.
- danellis 9y agoPony, too.
- limeblack 9y agoThe play button turning into a gear that spins is pretty cool. First time I have seen that.
- pavelbr 9y agoThe reason it's the first time you've seen might be because it's stupidly difficult to get that effect to work on IE/Edge. You might notice that there's a different effect on the run button for those browsers.
- cecicasa 9y agoThis is my code for Hello world in c++ https://tio.run/##HckxCoUwDADQPaeIuigoOGtx9hqSBinEVGqKg/yz96Pre3Sew05UShOUJHtGF@JlibdjAYCghscWtO3ggcv8NFHMhs5hvbJI7PGOSXxVv/Q9q5cZEltOiuMMv1L@ https://tio.run/##HckxCoUwDADQPaeIuigoOGtx9hqSBinEVGqKg/yz96...
- jjuhl 9y agoBroken piece of shi_ "g++: error: : No such file or directory g++: error: : No such file or directory /srv/wrappers/cpp-gcc: line 5: ./.bin.tio: No such file or directory"
- behnood85 9y agoI don't like it. I still prefer Codepen and jsfiddle.
- ygra 9y agoWhat do they do for languages other than JavaScript?
- behnood85 9y agoOk, then Codeanywhere would be a better choice. Don't you think? ;)
- TryItOnline 9y agoSaying that Codeanywhere is a better choice than TIO is like saying that GMail is a better choice than Netflix. In both cases, both services were built for different purposes, and neither one can or intends to replace the other.
- ohmatt 9y agoYeah, I don't see this as an attempt to be another Codepen or jsfiddle. This is just a way to easily test out features of a language, without going through the (sometimes very tedious) installation and setup processes required to code in certain languages locally.
- meggar 9y agono swift?
- pavelbr 9y agoTIO is powered by Fedora Linux, and unfortunatly the site's maintainer was unable to get the Linux port of Swift to work. This may change in the near future, however.
- _kst_ 9y agoI was pleasantly surprised to see my own joke language 99 in the list. https://github.com/Keith-S-Thompson/99 https://github.com/Keith-S-Thompson/99 I would have been even more pleasantly surprised if it worked.
- pavelbr 9y agoPlease contact @Dennis, the maintainer of TIO in talk.tryitonline.net, and tell him what isn't working. Fixes and language requests tend to be resolved within a day, because Dennis is awesome.
- _kst_ 9y agoIt turns out it's a different "99" language: https://codegolf.stackexchange.com/questions/47588/write-an-interpreter-for-99 https://codegolf.stackexchange.com/questions/47588/write-an-...
- prodikl 9y agoam i not getting this? i typed echo "hello"; for PHP and the output says "echo 'hello';" it just repeated back what i typed instead of processing the code hmm
- robbles 9y agoit works exactly like the real PHP interpreter: <?php echo "hello"; ?>
- jonahx 9y agoSome clarifications are in order: This site is not a competitor to codepen, jsfiddle, etc. It's main purpose is to allow play with programming languages you'd otherwise have to install locally -- specifically, it's extremely helpful when browsing https://codegolf.stackexchange.com/ https://codegolf.stackexchange.com/ -- the author is a prolific and impressive contributor to that site. It's sad to see a simple, well-designed, free, open-source project embracing the values of the HN crowd ("The TIO web app is free of charge, ad-free, and doesn't use tracking cookies or third-party analytic scripts.") -- and the top comment, as well as many others, are essentially a nitpick about a bug that can be trivially fixed.
- ouid 9y ago>It's sad to see No it's not. The top comment is a bug report because people are using the app. It also got fixed, which, for a comment chain, is about as much value as possible.
- deleted 9y ago[deleted]
- deleted 9y ago[deleted]
- a-b 9y agoCode samples for each language would be appreciated
- TryItOnline 9y agoLooks like getting mentioned on Hacker News is an excellent way to get your servers overloaded. :) I've added a couple of additional servers. I'll work on the issues that were brought up here asap. TIO only has two developers at this point (and only one of us works on the web app), so "asap" might take a little while.
- fatmotherpucker 9y agoGood job for the website though! It'll be very helpful to many people.
- netcyrax 9y agoSite is down.
- netcyrax 9y agoSite is down.
- winstonsmith 9y agoI really look forward to using this. It would be a great help to mobile users if uneeded options, e.g., 'header', could be made to disappear to save screen real estate.
- danieldrehmer 9y agoThis is pretty great! It would be nice to add swift and elixir on the list.
- arikrak 9y agoNice, looks pretty useful! I think the default execution time should probably be less than 60 seconds. Most simple programs that people run on this kind of site should have an execution time of less than a second, so ~10 seconds should certainly be enough by default. This would free up some resources on your end and would inform people more quickly that they may have an infinite loop in their code.
- potatoasdsadsad 9y agoOn codegolf.stackexchange.com we have answers that need all 60 seconds. This would not be viable
- jhgjklj 9y agoThe site is usable but can be made a lot better simply by changing the priorities. Hide all those compiler flags etc in the first page. The idea is if any one needs such advanced settings surely the source code will be multi page source code, even for the special use case it would be in the 1 % users. Include some template code which is readily compilable. THis is will be useful The sharable link should be integrated with reddit, google +, etc to be more resistance free sharing.
- ConorOBrien 9y agoExcept for in C, when you want to use the math library, you'd need the `-lm` option, which comes up fairly commonly.
- pmarreck 9y agoNeeds Elixir support. For the record, hello world in elixir is IO.puts "Hello World"
- pavelbr 9y agoYou can ping the site's maintainer, @Dennis, in talk.tryitonline.net. Bug reports and language requests tend to be resolved withing the same day of them being submitted, because Dennis is awesome.
- TryItOnline 9y agotalk.tryitonline.net requires an SE account and 20 rep. There's also https://gitter.im/tryitonline/Requests https://gitter.im/tryitonline/Requests (requires a Gitter account), https://github.com/TryItOnline/tryitonline/issues https://github.com/TryItOnline/tryitonline/issues (requires a GitHUb account), and email (feedback@tryitonline.net).
- TryItOnline 9y agoHere you go. https://tio.run/##S83JrMgs@v/f01@voLSkWEHJIzUnJ19HITy/KCdFUen/fwA https://tio.run/##S83JrMgs@v/f01@voLSkWEHJIzUnJ19HITy/KCdFUe...
- pmarreck 9y agoAwesome!!
- jamestimmins 9y agoThis is extremely cool. I'm impressed that they were able to get it up and running with so many different languages.
- ramgorur 9y agono c++/g++ ??
- potato44 9y agoIt is there. https://tio.run/#cpp-gcc https://tio.run/#cpp-gcc