Constructed Programming Languages

discussion and presentation

Page 1 of 1

14 Replies - 1993 Views - Last Post: 31 July 2009 - 01:35 PM

#1 Jaakuuta  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 163
  • Joined: 02-July 09

Constructed Programming Languages

Posted 28 July 2009 - 04:33 PM

I thought this would be a neat topic, though I wasn't sure where to post it. I figured it would be kind of fun if there was a discussion about our ideas for either programming languages, or programming concepts. The idea here is that if you have an idea for a programming language to some extent, whether it be keywords, syntax, concepts or the whole shebang, you can present it here. Then others can respond by either posting their own ideas, commenting on others', or even giving suggestions of existing languages that resemble their ideas. Eventually I think it would be neat if some of the more popular ideas take off and we sort of build our own D.I.C. constructed programming language :D

Anyway, I have a couple of ideas of my own...
First is a language called Escher (named after the awesome artist M.C. Escher) that I originally presented here
The next is one I've been considering lately... It's kind of inspired by a mix of the syntax and style of C, C++, and Objective-C, and the style and semantics are inspired by Joy and Forth. I call it Func-C (kind of a play on words, short for functional C, but sounds like funky or foxy)

The following would be an example of a factorial function
+fact
{
  0 =,
  1,
  cpy -- fact *,
  elif;
}



and this is how it would look in a program
+main
{
  5 fact print;
}



which would print 120 to the screen.

Is This A Good Question/Topic? 0
  • +

Replies To: Constructed Programming Languages

#2 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: Constructed Programming Languages

Posted 28 July 2009 - 07:04 PM

Interesting idea. The idea of combining functional programming and object-oriented programming would be an interesting experiment. Instead of C++ or objective-C, C# or Java syntax might look a little better. Any ideas on keywords you would have? (I haven't looked at functional programming in ages)
Was This Post Helpful? 0
  • +
  • -

#3 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Constructed Programming Languages

Posted 28 July 2009 - 09:51 PM

View PostSixOfEleven, on 28 Jul, 2009 - 06:04 PM, said:

Interesting idea. The idea of combining functional programming and object-oriented programming would be an interesting experiment...


DISCLOJURE (See what I did thar? :ph34r: ): This isn't a smart-ass remark!

The intent and purpose of this (rather popular for a functional language) language is to combine functional programming and object oriented programming in the most beautiful and powerful ways possible.

http://www.scala-lang.org
Was This Post Helpful? 0
  • +
  • -

#4 Jaakuuta  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 163
  • Joined: 02-July 09

Re: Constructed Programming Languages

Posted 29 July 2009 - 12:12 AM

the languages that you (Raynes) suggest usually seem fairly interesting... I might look into that one a bit more. My idea here was to mix something like C and Joy (two of my favorites) into something with a neat feel to it. Don't get me wrong, I love the idea of lambda expressions and whatnot, but I think it would be cool to mix the idea of combinators together with an OOP style and powerful programming abilities of a language like C.

As for keywords, I had a couple in my example, most of which are very similar to what they would be in C.
cpy for "copy" would work like the dup word in Forth/Joy
++ and -- would be words alone still meaning increment and decrement respectively...
elif would be simply an operator used fully for an if/else statement
* and & used directly before a word would still represent dereference and reference
+ and - would represent public and private for OOP
+=, -=, *=, /=, and %= would still represent the same operators in C
== would be used to set a variable, since = would be for 'equals'
this would make sense since != and the others listed above each have the = second
as for the comparison operators
=< and => would be for 'equals or less than' and 'equals or greater than'
:: would be used both for function signatures and function calls for objects
here are some more examples
|'class'| would be the keyword for class
~ would mean swap the last two elements
~~ would mean rotate the last three elements
` would mean drop the top element
+|ExampleClass|
{
  +power
  {
	1 =,
	`,
	-- power cpy *,
	elif;
  }
  +main
  {
	4 2,
	exp,
	==;
	exp print;
  }
}


This would yield 16...

This post has been edited by Jaakuuta: 29 July 2009 - 12:37 AM

Was This Post Helpful? 0
  • +
  • -

#5 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: Constructed Programming Languages

Posted 29 July 2009 - 12:38 AM

@Raynes
You win, I'll look at it. :P (Bookmarked page but now it is time for sleep.)
Was This Post Helpful? 0
  • +
  • -

#6 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Constructed Programming Languages

Posted 29 July 2009 - 01:04 AM

View PostJaakuuta, on 28 Jul, 2009 - 11:12 PM, said:

the languages that you (Raynes) suggest usually seem fairly interesting... I might look into that one a bit more. My idea here was to mix something like C and Joy (two of my favorites) into something with a neat feel to it. Don't get me wrong, I love the idea of lambda expressions and whatnot, but I think it would be cool to mix the idea of combinators together with an OOP style and powerful programming abilities of a language like C.

As for keywords, I had a couple in my example, most of which are very similar to what they would be in C.
cpy for "copy" would work like the dup word in Forth/Joy
++ and -- would be words alone still meaning increment and decrement respectively...
elif would be simply an operator used fully for an if/else statement
* and & used directly before a word would still represent dereference and reference
+ and - would represent public and private for OOP
+=, -=, *=, /=, and %= would still represent the same operators in C
== would be used to set a variable, since = would be for 'equals'
this would make sense since != and the others listed above each have the = second
as for the comparison operators
=< and => would be for 'equals or less than' and 'equals or greater than'
:: would be used both for function signatures and function calls for objects
here are some more examples
|'class'| would be the keyword for class
~ would mean swap the last two elements
~~ would mean rotate the last three elements
` would mean drop the top element
+|ExampleClass|
{
  +power
  {
	1 =,
	`,
	-- power cpy *,
	elif;
  }
  +main
  {
	4 2,
	exp,
	==;
	exp print;
  }
}


This would yield 16...


Sounds a lot like Factor. Factor is a full fledged Object Oriented programming language. It's full of combinators to help reduce the need to stack shuffling and stack diagrams and such. I suppose when you say C, you want to create a middle level language like C (or Forth, or is it lower?). I'm sure you have ideas that differ from Factor, but if you haven't checked out Factor, checking it out would be a great idea because there are lots of great things you can snatch away for ideas.

EDIT: To clarify, just the initial concept of the language you speak of sounds like Factor. The syntax and such are definitely light years different.

This post has been edited by Raynes: 29 July 2009 - 01:05 AM

Was This Post Helpful? 0
  • +
  • -

#7 Jaakuuta  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 163
  • Joined: 02-July 09

Re: Constructed Programming Languages

Posted 29 July 2009 - 02:02 AM

Indeed the syntax of what I saw was a bit misleading and I didn't recognize the use of combinators and whatnot right away. Indeed I was thinking with the intention of a lower-level language in mind. I generally tend to prefer lower-level languages and languages oriented towards logic and functional programming than those that are highly specialized. I'm usually the type that does a lot of stuff with the command line anyway and I prefer not to bother with all the graphical nonsense... although it's good for making programs for others that like that kind of thing, but unless I'm playing a video game or something, I could care less about graphics and guis and whatnot...
Was This Post Helpful? 0
  • +
  • -

#8 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,412
  • Joined: 29-May 08

Re: Constructed Programming Languages

Posted 29 July 2009 - 12:11 PM

View PostSixOfEleven, on 29 Jul, 2009 - 02:04 AM, said:

Interesting idea. The idea of combining functional programming and object-oriented programming would be an interesting experiment. Instead of C++ or objective-C, C# or Java syntax might look a little better. Any ideas on keywords you would have? (I haven't looked at functional programming in ages)


You just described F# (Functional, Object-Orientated .net Language)
Was This Post Helpful? 0
  • +
  • -

#9 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Constructed Programming Languages

Posted 29 July 2009 - 01:35 PM

View PostAdamSpeight2008, on 29 Jul, 2009 - 11:11 AM, said:

View PostSixOfEleven, on 29 Jul, 2009 - 02:04 AM, said:

Interesting idea. The idea of combining functional programming and object-oriented programming would be an interesting experiment. Instead of C++ or objective-C, C# or Java syntax might look a little better. Any ideas on keywords you would have? (I haven't looked at functional programming in ages)


You just described F# (Functional, Object-Orientated .net Language)


Scala is actually closer than F# to what he is talking about. F#'s syntax is OCaml's syntax, straight up. Scala focuses more on blending OOP and FP in the best possible ways, from what I can tell, Scala's solution turns out more elegant than OCamls. I could be wrong, I've done little with OCaml and F#. At the very least, Scala takes the lead because of it's syntax, since he said Java/C# syntax might look better.
Was This Post Helpful? 0
  • +
  • -

#10 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: Constructed Programming Languages

Posted 29 July 2009 - 07:37 PM

If I had the time and sit down and learn a new language I would take a look them. To many other projects on the go. Scala did look interesting though. I'll take a look at F# as well. Thanks for recommending them to both of you.
Was This Post Helpful? 0
  • +
  • -

#11 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Constructed Programming Languages

Posted 30 July 2009 - 02:32 AM

I want to write a language called Poptart.
Was This Post Helpful? 0
  • +
  • -

#12 Jaakuuta  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 163
  • Joined: 02-July 09

Re: Constructed Programming Languages

Posted 30 July 2009 - 02:27 PM

View PostRaynes, on 30 Jul, 2009 - 01:32 AM, said:

I want to write a language called Poptart.

poptart? :blink:
if you're serious, could you give a bit more information about your idea?
Was This Post Helpful? 0
  • +
  • -

#13 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 611
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

Re: Constructed Programming Languages

Posted 30 July 2009 - 04:50 PM

I wasn't really serious. Just, if I ever make a language, poptart will be on the list of names to consider. :)
Was This Post Helpful? 0
  • +
  • -

#14 Jaakuuta  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 163
  • Joined: 02-July 09

Re: Constructed Programming Languages

Posted 31 July 2009 - 12:10 AM

haha... that would be odd...

<p0pt@rt>
# This is poptart
pop(tart);
tartedPop?
true;


haha
Was This Post Helpful? 0
  • +
  • -

#15 Amrykid  Icon User is offline

  • 4+1=Moo
  • member icon

Reputation: 148
  • View blog
  • Posts: 1,589
  • Joined: 16-December 08

Re: Constructed Programming Languages

Posted 31 July 2009 - 01:35 PM

View PostRaynes, on 30 Jul, 2009 - 02:32 AM, said:

I want to write a language called Poptart.

i died when you said that :P
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1