Re: [fonc] Can semantic programming eliminate the need for Problem-Oriented Language syntaxes?

2012-03-01 Thread BGB

On 3/1/2012 10:25 AM, Martin Baldan wrote:
Yes, namespaces provide a form of "jargon", but that's clearly not 
enough. If it were, there wouldn't be so many programming languages. 
You can't use, say, Java imports to turn Java into Smalltalk, or 
Haskell or Nile. They have different syntax and different semantics. 
But in the end you describe the syntax and semantics with natural 
language. I was wondering about using a powerful controlled language, 
with a backend of, say, OWL-DL, and a suitable syntax defined using 
some tool like GF (or maybe OMeta?).




as for Java:
this is due in large part to Java's lack of flexibility and expressiveness.

but, for a language which is a good deal more flexible than Java, why not?

I don't think user-defined syntax is strictly necessary, but things 
would be very sad and terrible if one were stuck with Java's syntax 
(IMO: as far as C-family languages go, it is probably one of the least 
expressive).


a better example I think was Lisp's syntax, where even if at its core 
fairly limited, and not particularly customizable (apart from reader 
macros or similar), still allowed a fair amount of customization via macros.



but, anyways, yes, the "language" problem is still a long way from 
solved, and so instead it is a constant stream of new languages trying 
to improve things here and there vs the ones which came before.



___
fonc mailing list
fonc@vpri.org
http://vpri.org/mailman/listinfo/fonc


Re: [fonc] Can semantic programming eliminate the need for Problem-Oriented Language syntaxes?

2012-03-01 Thread Martin Baldan
Yes, namespaces provide a form of "jargon", but that's clearly not enough.
If it were, there wouldn't be so many programming languages. You can't use,
say, Java imports to turn Java into Smalltalk, or Haskell or Nile. They
have different syntax and different semantics. But in the end you describe
the syntax and semantics with natural language. I was wondering about using
a powerful controlled language, with a backend of, say, OWL-DL, and a
suitable syntax defined using some tool like GF (or maybe OMeta?).
___
fonc mailing list
fonc@vpri.org
http://vpri.org/mailman/listinfo/fonc


Re: [fonc] Can semantic programming eliminate the need for Problem-Oriented Language syntaxes?

2012-03-01 Thread David Barbour
On Thu, Mar 1, 2012 at 4:25 AM, Martin Baldan  wrote:

> Hi,
>
> What got me wondering this was the fact that people, as far as I know,
> don't use domain-specific languages in natural speech. What they do use is
> jargon, but the syntax is always the same. What if one could program in
> something like ACE, specify a jargon and start describing data structures
> concisely and conveniently in a controlled language? That way, whenever
> there is a new problem, you would only have to specify what kind of
> entities you want to use, what properties they can have, and so on.
>
> I guess I want something like this:
>
> http://en.wikipedia.org/wiki/Semantic-oriented_programming
>
>
> What are your thoughts?
>


I'll need to chew a lot longer on Semantic Oriented Programming before I
can form a valid opinion.

But with regards to jargons - domain specific language extension is already
the role of libraries, and adding specific notations doesn't hurt.

I note another thing we don't use in normal speech is parameters. We use
adjectives, adverbs, and context.

Regards,

Dave
___
fonc mailing list
fonc@vpri.org
http://vpri.org/mailman/listinfo/fonc


Re: [fonc] Can semantic programming eliminate the need for Problem-Oriented Language syntaxes?

2012-03-01 Thread BGB

On 3/1/2012 5:25 AM, Martin Baldan wrote:

Hi,

What got me wondering this was the fact that people, as far as I know, 
don't use domain-specific languages in natural speech. What they do 
use is jargon, but the syntax is always the same. What if one could 
program in something like ACE, specify a jargon and start describing 
data structures concisely and conveniently in a controlled language? 
That way, whenever there is a new problem, you would only have to 
specify what kind of entities you want to use, what properties they 
can have, and so on.


I guess I want something like this:

http://en.wikipedia.org/wiki/Semantic-oriented_programming


What are your thoughts?



(not entirely sure I understand "SOP" at the moment, so responding more 
"in general").



to some extent, this is a role served by packages/namespaces in 
languages which have them.
namely, each package may have its own collections of various objects, 
which one can use via importing it.


otherwise, it is useful to have a reasonably expressive core language 
(IMO: this is where languages like Java fall on their face...), such 
that ideally it is not really necessarily for people to roll their own 
syntax and semantics for various tasks.


otherwise, the language should not be rigidly stupid in brain-damaged 
ways (also, IMO, a bit of a problem with Java and friends). this is 
where something "could" be presumably trivially expressed in the 
language, if only the compiler allowed it.


this was one area where C did a lot better than Java (and to a some 
extent, C++).
in C, nearly everything in the syntax which wasn't a statement, was an 
expression;
more so, C code is essentially just a list of expressions separated by 
semicolons (with a few exceptions, such as declarations and 
block-statements).


now, Java sort of "watered it down" a bit, by adopting a more watered 
down concept of "an expression", and essentially making most everything 
else be fixed form statements. not everything was bad: they watered down 
declarations in a way that made parsing them syntactically unambiguous 
(a problem in both C and C++ is that one needs to deal with context to 
be able to correctly parse the code, but both Java and C# mostly 
addressed this problem).


a weakness in Java, though, is that one can only call "methods", say:
"object.method()", "package.class.method()", ..., rather than being able 
to call arbitrary expressions (like in C and C++);
there are also no first-class functions or methods (C and C++ had these 
implicitly, C# "added" them as "delegates"), seriously it took until the 
JDK7 for Sun/Oracle to get around to adding them (never-mind the 
half-baked "lambdas"/"closures", which don't properly capture scope, and 
which require using a method to call "lambdaObj.invoke(...)", ...);

for fairly obvious reasons, one can't do curried functions in Java.

nevermind some ways Java's type-system is brain-damaged, ...


ultimately, all of its limitations and arbitrary restrictions IMO make 
Java a bit lame as a language (coupled with the weak JVM architecture), 
is part of why although I could technically support both, I didn't 
really bother maintaining it (I personally found it preferable to port 
Java code to my BGBScript language, which is, IMHO, less arbitrarily 
stupid, albeit at the cost of there being some minor syntactic 
differences which are kind of a hassle, such as the different type-cast 
syntax, ...).



a language which allows, say:
first class functions, and closures with semantics that make sense (they 
retain a copy of the parent scope, not some read-only by-value copy, or 
have the closure become invalid as soon as the parent returns);

calling arbitrary expressions, and using curried function calls;
ability to use dynamic and inferred types without a lot of extra pain;
ability to roll ones' own scoping as needed (such as via the use of 
delegation);

...

is a bit more useful IMO.
if the core language can compactly express ones' intents, why need a 
specialized DSL to try to be more compact?...



the weakness of C++, like that is Java, is that many of its newly added 
features were bolted on in often one-off forms, and where orthogonality 
either fails, or introduces new arbitrary "features" to address cases 
which should have theoretically followed from taking the prior features 
to their logical extremes (granted, it is not like C++ hasn't taken many 
of its features to extremes though...).


a bigger weakness though is that both the syntax and semantics are, in 
some was, ad-hoc, over-complicated, and its dependence on context has 
become a bit excessive.


or, at least, this is a few of my thoughts at the moment.


or such...




___
fonc mailing list
fonc@vpri.org
http://vpri.org/mailman/listinfo/fonc


___
fonc mailing list
fonc@vpri.org
http://vpri.org/mailman/listinfo/fonc


[fonc] Can semantic programming eliminate the need for Problem-Oriented Language syntaxes?

2012-03-01 Thread Martin Baldan
Hi,

What got me wondering this was the fact that people, as far as I know,
don't use domain-specific languages in natural speech. What they do use is
jargon, but the syntax is always the same. What if one could program in
something like ACE, specify a jargon and start describing data structures
concisely and conveniently in a controlled language? That way, whenever
there is a new problem, you would only have to specify what kind of
entities you want to use, what properties they can have, and so on.

I guess I want something like this:

http://en.wikipedia.org/wiki/Semantic-oriented_programming


What are your thoughts?
___
fonc mailing list
fonc@vpri.org
http://vpri.org/mailman/listinfo/fonc