Live data from Hacker News

Batsh – A language that compiles to Bash and Windows Batch

batsh.org

31–40 of 130 posts

Re: Batsh – A language that compiles to Bash and Windows Batch

#31
I want this to be great; it would solve no end of problems at my workplace.

Unfortunately, "You have to install OCaml (version 4.00.1 or higher) development environment before compiling Batsh" (not to mention "1. Install OPAM. See instructions.") basically makes it a non-starter for my purposes.

Why can't this take a batch file and translate it to Bash? Or vice-versa? Genuine question - I do not have a sufficient understanding of the fundamentals to guess.

Re: Batsh – A language that compiles to Bash and Windows Batch

#32

I can't think of a case where seamlessly having two different targets like this has worked - particularly if there's pressure to really support all of the features of both.

Unity 3d. Haxe. [1] GWT. [2] There are tons of cross-platform toolkits that do this for games; having something that does it for SHELL SCRIPTING seems trivial by comparison.

Yes it does happen that some features get neglected, but we're talking shell scripting here. They could hit the 80% use case and it would be totally useful.

[1] http://haxe.org/

[2] http://www.gwtproject.org/overview.html

Re: Batsh – A language that compiles to Bash and Windows Batch

#33

Earlier quoted context omitted.

I reckon you don't, because it's not supported in windows batch. Just googled it. Doesn't seem to be supported yet: https://github.com/BYVoid/Batsh/issues/17

I reckon you don't, because it's not supported in windows batch. Sure it is: http://www.microsoft.com/resources/documentation/windows/xp/...

Only half-way; it doesn't stream the data, it waits for the first command to finish, saves the entire output, then starts the second command with output as input.

Re: Batsh – A language that compiles to Bash and Windows Batch

#34

I want this to be great; it would solve no end of problems at my workplace. Unfortunately, "You have to install OCaml (version 4.00.1 or higher) development environment before compiling Batsh" (not to mention "1. Install OPAM. See instructions.") basically makes it a non-starter for my purposes. Why can't this take a batch file and translate it to Bash? Or vice-versa? Genuine question - I do not have a sufficient und…

They are both hideous languages with myriad diverging features. Translating them into each other would either require extra runtime dependencies or obscene amounts of hideous code in either language.

By coming up with a third language the author could conveniently pick a subset of features that could easily be implemented in both languages without much goat slaughtering.

Re: Batsh – A language that compiles to Bash and Windows Batch

#35
post #33

Earlier quoted context omitted.

I reckon you don't, because it's not supported in windows batch. Sure it is: http://www.microsoft.com/resources/documentation/windows/xp/...

Only half-way; it doesn't stream the data, it waits for the first command to finish, saves the entire output, then starts the second command with output as input.

Hum, I don't remember it behaving that way. Why do you say so?

Re: Batsh – A language that compiles to Bash and Windows Batch

#36

I want this to be great; it would solve no end of problems at my workplace. Unfortunately, "You have to install OCaml (version 4.00.1 or higher) development environment before compiling Batsh" (not to mention "1. Install OPAM. See instructions.") basically makes it a non-starter for my purposes. Why can't this take a batch file and translate it to Bash? Or vice-versa? Genuine question - I do not have a sufficient und…

You probably want to look into solutions like Puppet or Chef

Re: Batsh – A language that compiles to Bash and Windows Batch

#37
There's no mention of error handling, which is what really makes Windows batch files completely hopeless for anything involving more than one or two commands. Being able to write code with exceptions and having it compiled to the corresponding mess of ERRORLEVEL and GOTO would be sweet!

(I've switched to just writing everything in JavaScript for WSH. It's ECMAScript 3 and the API has some issues, but it's still a million times better than trying to write any logic in batch.)

Post reply on HN