• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Is there any java equivalent of .csx files as in C#?  RSS feed

 
Ranch Hand
Posts: 1045
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In C# there is a concept of .csx files. Is there any java equivalent of .csx files as in C#? If not so then why?
 
Saloon Keeper
Posts: 2406
296
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are .csx files, and when are they used with C#?
 
Sheriff
Posts: 5745
148
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:What are .csx files, and when are they used with C#?


I don't know much about them, but they appear to be C# script files.

Monica Shiralkar wrote:Is there any java equivalent of .csx files as in C#? If not so then why?


I'm not familiar with how one might use a csx file, but if it's a script, maybe JShell would work.
 
Monica Shiralkar
Ranch Hand
Posts: 1045
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What are .csx files, and when are they used with C#?



I looked at the code for creating an azure function (serverless) . In C# they have mentioned the save it as .csx file (instead of .cs file). However, in java it is saved at .java only.
 
Knute Snortum
Sheriff
Posts: 5745
148
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you can save a JShell session as a .jsh file and execute it with JShell, but I'm not sure what this gets you.  What are you trying to accomplish?
 
Saloon Keeper
Posts: 20510
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I'm not even sure why csx files exist in Windows, much less why anything like them is so important on other OS's.

From the sound of it, a close equivalent might be Groovy.

But in truth, I kind of suspect that a lot of the reason for .csx is that until PowerShell came along, the Windows command shell/scripting environment was very, very feeble.

In contrast, the Unix and Unix-like OS's have always had very powerful shells and a rich set of support tools such as grep, sed, awk, perl, and the like plus frameworks like Tcl. And more recently, Python, among others. Most of these can be acquired for a Windows machine, but in the *n*x OS's, you can consider them as standard and not have to pull them in from third-party sources.
 
Master Rancher
Posts: 58
6
Mac Mac OS X Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a Roslyn based interpreter that lets you do REPL based programming in C# similar to other REPL languages. CSX files are used with csi.exe which is the interactive C# REPL.  There is a window in Visual Studio called "C# Interactive" that lets you run this as well.   If you want to interactively program with a REPL, use csx files. OR if you want to make quick snippets to interact with both your Visual Studio and as a command line.

https://msdn.microsoft.com/en-us/magazine/mt614271.aspx
https://www.red-gate.com/simple-talk/dotnet/net-development/going-interactive-c/

In the .NET world, lots of people still use LINQPad to do ad-hoc exploration and execution in .NET languages. But this was because there was no REPL to do quick, ad-hoc programming. However LINQPad is God-like when you are exploring data interactively.


CSX files are not a replacement for Powershell or a replacement for the old Windows Scripting Host(VBScript or JScript)
 
Note to self: don't get into a fist fight with a cactus. Command this tiny ad to do it:
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!