here is the up2date list of all “realistic” proposals
http://blogs.sun.com/darcy/entry/project_coin_consideration_round_2
note: AFAIK only 5 or 6 will make it into jdk7 at the end of the process
here is the up2date list of all “realistic” proposals
http://blogs.sun.com/darcy/entry/project_coin_consideration_round_2
note: AFAIK only 5 or 6 will make it into jdk7 at the end of the process
I’m going to reply in the reversed order since the answers make more sense that way…
Since the view doesn’t exist as an actual file it’s impossible to check that in. Have you ever tried checking in a piece of source with code folded?
Sure you can the java code that backs the shorthand is simply copied to the clipboard.
It’s DSL like so you are going to need additional stuff here it’s a plug-in somewhere else it’s a interpreter or a compiler. A decent implementation stands or falls with how well the java source code that backs the shorthand syntax can be read. Since esp in the beginning very few will have the plug-in and the rest simply looks at the java source code backing it, so if that is crap to look at…
I’m not married to this at btw, regardless of how it looks.
This is what you said earlier:
This is what you say now:
Those are two very different things. I definitely agree with the 2nd version.
yeah my bad (as usual)
I type up words explaining stuff and then reading it back I realise that it doesn’t relay the message as I though it would so I end up modifying it a lot as I go through that cycle a couple of times.
I suppose it had to be something alike "You miss the point where it doesn’t need to be a java sourcefile. "… your looking at or something. Anyway I hope I have been able to relay it better/clarified it my other messages.
There’s a reason why I usually dictate stuff and let others freely put it into writing. Blessed are those who are able to put their thought clearly into words.
Some people have been doing whatever they want in programming languages using a feature called “macros” present in Lisp languages since the 60s. Everything would be much easier, not just this example, if Java had macros.
I wonder why people insist in creating special syntax for whatever little BS they can think of if they could just write macros! And I wonder why in 40 years nobody ever thought about copying such a valuable feature from Lisp.
I mean, in the 70s and 80s you would have some justification for using languages lacking in features and that look and write like vomit, like C for example, but for God’s sake, we have gigabytes of RAM and multicore processors now. There’s no excuse. It is simply idiotic.
It is not just Java, it is most languages out there. C# is a mess and LINQ is just a workaround for the sheer stupidity of programming language designers.
We don’t need more crappy syntax to complicate things even further. We need macros. A much more intelligent way of dealing with such problems.
I submit that “macros” might just be another way of saying “compiler plugins”. I also suspect compiler plugins would be more flexible, delegating as they would the compilation of particular bits of text to a completely separate compiler. Possibly.
Cas
I wish Java would be stuck in the 50s, right when Lisp came to be. And I wish were a Lisp dialect. Then all the problems cited by you and others wouldn’t exist.
Java doesn’t need to copy C#, Java needs to go back in time and learn how to do it right.
No, macros are a language feature, just like functions, where you can generate different code sequences based on parameters received from the macro call. With the option of nesting parameter lists, so you can have entire trees of data to play with and generate the correct code.
This way you would be able to create a “select” call yourself and it would be compiled into the usual JDBC calls you always need to do. It wouldn’t be a function invocation, it would be just that you would write the code the way you want to do it, like a shortcut syntax, and the language would handle the generation of the code for that.
Perhaps, in a sense, but I’d probably put true Lisp-style macros a step or two above what a compiler plugin system would realistically enable. The essence of the macro (a real macro, not the C++ #ifdef crap that people think of when they hear the word) is that if you’re working in language X, you can write code in language X that acts on code trees in that same language, and you can do so right next to the code that you need to transform. So you can redefine your syntax as you need to without so much as a context switch.
The main weakness of plugins compared to true macros is that there’s a lot of burden involved in changing a compiler plugin to do what you need and then installing it, i.e. the context switch is pretty painful. It’s not exactly the type of thing that you can do for a one-off code transformation or as part of your day-to-day coding, to say the least, even in (say) Scala where the compiler plugin system is fairly good. Contrast that with Lisp, where a real good Lisper will write maybe 20% macros, 80% other code.
But macros in Java? Never going to happen. Might be nice (I’d probably even vote for the proposal), but macros are the ultimate power-user (read: dangerous for nubz/large teams) feature, and even languages with a lot more balls than Java usually decide against allowing them. That’s not even to mention the technical difficulties that would need to be overcome to wedge a useful macro system in to such a syntactically rich language…
Ahem. My esteemed forumers cannot see the wood for the trees.
Missing macros? Simple. Add a compiler plugin that does them. Job done.
Cas
//edited
Software that gets used has source that gets read by more then one person.
It’s obvious what point you’re trying to make, but you fail miserably.
It’s both insulting and it makes no sense at all.
pff, though if you got it why didn’t you help out by explaining it better? (no smear there, I’m be honest and certainly not below asking for help)
Also if the point that I’m making is obvious how did I fail miserably at relaying it? Perhaps the packaging could be better, but I already pointed out that I lack the finesse to ‘wrap it right’.
Some how I figured, that if I didn’t made a stark comment that people would not read into the subtlety of it all.
if it was about poking fun at Cas, then explain me through pm why that was so bad?
I don’t mind being poked fun at. I am immune.
So I think the chief argument might have been there - I don’t know coz it was edited out before I got to see it - is that the very thought of some different syntax appearing in some source code gives some programmers the willies?
And yet here I am, coping with the addition of generics and enhanced for loops, and writing SQL on a daily basis albeit inconveniently in different files.
I think all it takes is for people to vote the best features to the top of the pile, and the nasty ones will never make it into serious production. Nobody will take a plugin seriously that allows you to write in Brainfuck but you will be allowed to write one. But the rest of us who need a few DSL-like features in our source code will pick the best and most productive ones. So I’ll take SQL-syntax-for-collections for starters. And I bet closures would become popular. If I didn’t understand the source code, well, that’s really my fault for not learning it. But then I don’t understand Lisp and you don’t see me whinging at the Lisp programmers that I can’t understand their source.
Cas
Cas, do you have thoughts on the specifics of a compiler plug-in proposal that we could discuss or comment on (read: argue about :P)? Is that what this thread is meandering towards, or is this “for fun”? Also, are there any similar proposals already on the table (or that have been rejected right off of it)?
I still think getting something like this in is a bit of a long shot, but I think you’re right that it could quiet a lot of the bitching about language changes without stepping on anyone’s toes or forcing the masses to learn something new.
This thread has brought up a couple important objections, which are worth thinking about in more detail, since they’d come up a lot in any discussion about this:
Other objections? Solutions? Comments? Bueller?
Of course… all the most successful game companies are using LISP. In fact most of the software you see on the shelves in any store is written in LISP. That’s what makes it such a dominant language today. Why, I can name at least one whole program done in LISP! The rest use SmallTalk of course. Beat that you Java and C lovers!
LOL
Not exactly what Cas is looking for, but you may want to check out Jetbrains MPS (Meta Programming System) and mpssql.
'fraid it’s just fun. I’ll be happy with structs. I’m otherwise too busy writing games and earning no money.
Cas