Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

New language you can read aloud

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/?

Name: Anonymous 2010-11-12 0:04

>>1
Yeah, okay. I'll program in Forth with you.

Name: Anonymous 2010-11-12 0:05


f=λn:(n<=1)?1:n*f(n-1)
f(int(<>))→<stdout>


[spoiler]VALID PERL6 CODE?

Name: Anonymous 2010-11-12 0:08

>>3

Fairly sure you can't use some of those symbols in a plaintext file...

Name: Anonymous 2010-11-12 0:11

>>1
You mena like basic or pascal? They shit.

Name: Anonymous 2010-11-12 0:14

get the book "Seven Languages in Seven Weeks" and learn Io and see your language already exists

Name: Anonymous 2010-11-12 0:29

It's called COBOL.

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.

Name: Anonymous 2010-11-12 0:57

>>5

I mean like how ruby sometimes reads like english...

But with less symbols.

Name: Anonymous 2010-11-12 1:34

>>9

                    end
                end
            end
        end
    end
end


English as my anus!

Name: Anonymous 2010-11-12 2:45

>>10
arse?

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

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.

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.

Name: Anonymous 2010-11-12 10:16

>>14
(set! my-anus #\!)

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

Name: Anonymous 2010-11-12 12:07

>>4
have you ever heard of APL?

Name: Anonymous 2010-11-12 13:01

>>4
Fairly sure you're a moron.

Name: Anonymous 2010-11-13 6:24

>>4
Fairly sure you can't tell ASCII from text from plaintext.

Name: Anonymous 2010-11-13 10:19

>>17-19
Fairly sure you have bitch tits.

Name: Anonymous 2010-11-13 14:27

>>7
This.
Welcome to 50 years ago.

Name: Anonymous 2010-11-13 17:31

>>17-19
Fairly sure YHBT

Name: Anonymous 2011-02-02 23:31

Name: Anonymous 2011-05-02 13:34

test VALID PERL CODE

Don't change these.
Name: Email:
Entire Thread Thread List