Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  Scripting languages / DSLs?  (Read 6834 times)
0 Members and 1 Guest are viewing this topic.
Offline ags1

JGO Wizard


Medals: 78
Projects: 3
Exp: 5 years


Make code not war!


« Reply #30 - Posted 2012-09-18 20:02:26 »

There is a grey area between a declarative DSL and pure data, or between a DSL and a highly structured API.

Offline Best Username Ever

Junior Devvie





« Reply #31 - Posted 2012-09-18 20:30:49 »

Not necessarily.  It would be pretty easy to write a DSL for the JVM that outperforms Java in some areas.

I don't know how much space the JVM instruction set leaves to outperform Java, but I imagine it would be pretty hard (even relative to coding your own compiler for the JVM.) Maybe something as fast would be relatively simple. It depends on what the JVM is capable of. Do you have an example scenario where it would execute faster?
Offline Roquen
« Reply #32 - Posted 2012-09-18 21:07:07 »

float foo(float x) { return x + 0.f; }
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline arnaud_couturier
« Reply #33 - Posted 2012-09-19 01:09:37 »

Stay away from scripting languages as long as you can.

As soon as it is necessary for someone non-developer (end users, designers, ...) to change some behavior in the program WITHOUT having the full development environment (jdk, IDE, etc...) THEN consider using a scripting language.

And before diving into full blown languages, perhaps configuration files parsing could be enough.

Worrying about performance is just masturbation IMO.
Unless you're trying to code a 3d engine with Groovy.
Offline Roquen
« Reply #34 - Posted 2012-09-19 06:34:33 »

I'd say do the math:  Do you have a reasonable expectation to save over twice the total development time (including risk, maintenance, etc. etc.) over not using a DSL.  If the answer's no, then pass.  Attempting to out-perform Java is an unlikely goal for a game DSL.
Offline nsigma
« Reply #35 - Posted 2012-09-19 11:21:14 »

Worrying about performance is just masturbation IMO.

Worrying about performance in performance critical code is never just masturbation IMO!  Tongue

One of Janino's key uses is as a live function compiler for repeatedly called functions.  Personally in my comment above about lamdas I'm particularly thinking of live-coding things like audio DSP.  There is a VST plugin somewhere that embeds Janino for this very purpose.

Now, that's a less likely thing for a game mod, but there are things like pixel ops, procedural textures, physics functions, etc. which could be quite interesting to mod on the fly, but still need high performance.  Admittedly, some of those are possibly better done with live-modified GLSL shaders, but that would be a performance choice!  Wink

My key thinking is that game code and user modded code should have (the potential for) equal performance.

float foo(float x) { return x + 0.f; }

Er ... any useful examples that don't involve programmer stupidity?!  Grin

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline Roquen
« Reply #36 - Posted 2012-09-19 11:26:40 »

That's not programmer stupidity.  It's a useful function: converting negative zeros into positive zeros.  Just most people don't care about that.  That's just the most trivial example of a transform that's illegal for Java the high level language to perform that popped into my head.  Floating point is loaded with these kinds a transforms.

a+1+1 != a+2
(a+b)-a != b
a/10 != a*(1/10)
etc, etc.

The strictness of Java the high level language makes many transforms illegal.
Offline nsigma
« Reply #37 - Posted 2012-09-19 11:39:29 »

That's not programmer stupidity.  It's a useful function: converting negative zeros into positive zeros.

Ah, OK, see what you're getting at - an explanation would have been good (for me at least!  Grin )

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Offline arnaud_couturier
« Reply #38 - Posted 2012-09-20 03:23:49 »

Worrying about performance in performance critical code is never just masturbation IMO!  Tongue
You wouldn't write performance critical code with a scripting language, would you ?
I hope not, for your sake...
Offline nsigma
« Reply #39 - Posted 2012-09-20 10:27:48 »

Worrying about performance in performance critical code is never just masturbation IMO!  Tongue
You wouldn't write performance critical code with a scripting language, would you ?

No, and I think I see my point flying over your head somewhere!  Tongue

There are some (not many, admittedly) interesting uses for allowing people to modify performance critical code at runtime (I gave some examples).  My point is exactly that I wouldn't use a scripting language for this purpose, in which case it comes down to live-compiling and inserting Java code at runtime.  This is the whole reason why Janino exists at all!

Praxis LIVE - open-source intermedia toolkit and live interactive visual editor
Digital Prisoners - interactive spaces and projections
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline arnaud_couturier
« Reply #40 - Posted 2012-09-20 21:51:08 »

Yes, Java blurs the line between compiled code and interpreted code.
So in that case yes, "dynamic compilation" can be used if performance matters  Smiley
Thanks Java !

Though, as you pointed out, I can't see a practical example, but I'm sure plenty of people need it for good reason...

Pages: 1 [2]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (24 views)
2014-12-23 03:34:11

rwatson462 (54 views)
2014-12-15 09:26:44

Mr.CodeIt (45 views)
2014-12-14 19:50:38

BurntPizza (86 views)
2014-12-09 22:41:13

BurntPizza (110 views)
2014-12-08 04:46:31

JscottyBieshaar (80 views)
2014-12-05 12:39:02

SHC (91 views)
2014-12-03 16:27:13

CopyableCougar4 (98 views)
2014-11-29 21:32:03

toopeicgaming1999 (157 views)
2014-11-26 15:22:04

toopeicgaming1999 (154 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!