New language you can read aloud
1
Name:
Anonymous
2010-11-11 23:54
So what if we had a language that depended mostly on keywords (and less on punctuation) that read like the english language?
Something like
let fact of n be
1 if n is 0
n * fact of n otherwise
end
let main be
x = gets
x = fact of x
print x
end
Okay, it looks like crap, but it's just a concept. Ideas /prog/?
2
Name:
Anonymous
2010-11-12 0:04
>>1
Yeah, okay. I'll program in Forth with you.
3
Name:
Anonymous
2010-11-12 0:05
f=λn:(n<=1)?1:n*f(n-1)
f(int(<>))→<stdout>
[spoiler] VALID PERL6 CODE?
4
Name:
Anonymous
2010-11-12 0:08
>>3
Fairly sure you can't use some of those symbols in a plaintext file...
5
Name:
Anonymous
2010-11-12 0:11
>>1
You mena like basic or pascal? They shit.
6
Name:
Anonymous
2010-11-12 0:14
get the book "Seven Languages in Seven Weeks" and learn Io and see your language already exists
7
Name:
Anonymous
2010-11-12 0:29
It's called COBOL.
8
Name:
Anonymous
2010-11-12 0:48
>>6
>>7
I'm talking about a language that will look less like crap and have more modern features.
9
Name:
Anonymous
2010-11-12 0:57
>>5
I mean like how ruby sometimes reads like english...
But with less symbols.
10
Name:
Anonymous
2010-11-12 1:34
>>9
end
end
end
end
end
end
English as my
anus !
11
Name:
Anonymous
2010-11-12 2:45
12
Name:
Anonymous
2010-11-12 2:46
You want voice-readable? Here's voice-readable:
10 PRINT "This is a"
20 PRINT "haiku program"
30 GOTO 10
13
Name:
Anonymous
2010-11-12 5:15
Pointless verbosity. fact(n) reads "fact of n", but can't you read that aloud while still writing and looking at fact(n)? You are reading * as "by" after all, so why not with some more symbols? Saving typing time and screen state is a good thing, so an English-like programming language is not a great idea. On top of that, you'd have to memorize all sort of insane rules in order to avoid using parens because natural language is naturally bad at that. For example, how would you write (f 1 (f 1 2 (f 1 2 3)) 3) ? "eff of one and eff of one, two and eff of one, two and three, that does it for the last eff, that does it for the last eff, then three, that does it for the last eff"? So simple to understand as an S- or M-expression, so difficult to understand otherwise. There are things that natural language is not for.
For languages like this, refer to COBOL and LOLCODE.
(define (fact n)
(if (zero? n)
1
(* n (fact n)))) ;note bug
(define (main)
(define x (read))
(set! x (fact x)
(display x)
Looks nicer to me.
14
Name:
Anonymous
2010-11-12 5:17
>>13
Failed the last bit of Scheme because I was in a hurry, add closing parens for me in lines LAST and (- LAST 1) please.
15
Name:
Anonymous
2010-11-12 10:16
16
Name:
Anonymous
2010-11-12 11:09
ENTERPRISE BASIC
start:
if length_of(@ARGS) eq 1
goto helloworld
goto loop_args
loop_args:
// <type>(<maxrange_from>, <maxrange_to>)
declare idx as integer(0, 255)
declare argument as string(0, 512)
set idx = 0
.print_argument:
if idx eq length_of$(@ARGS)
goto .end_arguments
set argument = index_of(@ARGS, idx)
print "args[" & idx & "] = " & argument & "\n"
set idx = incr(idx)
goto .print_argument
.end_arguments
nothing
helloworld:
print "Hello World"
goto finish
finish:
end
17
Name:
Anonymous
2010-11-12 12:07
>>4
have you ever heard of APL?
18
Name:
Anonymous
2010-11-12 13:01
>>4
Fairly sure you're a moron.
19
Name:
Anonymous
2010-11-13 6:24
>>4
Fairly sure you can't tell ASCII from text from plaintext.
20
Name:
Anonymous
2010-11-13 10:19
>>17-19
Fairly sure
you have bitch tits.
21
Name:
Anonymous
2010-11-13 14:27
>>7
This.
Welcome to 50 years ago.
22
Name:
Anonymous
2010-11-13 17:31
23
Name:
Anonymous
2011-02-02 23:31
24
Name:
Anonymous
2011-05-02 13:34
test VALID PERL CODE