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

Programming Thread

Name: Anonymous 2013-10-03 0:11

This thread is about /prog/ramming for /prog/rammers and /DPT/ers

What are you working on?

Name: Anonymous 2013-10-03 0:13

I'm working on my microkernel using the OSDEV tutorials

Name: Anonymous 2013-10-03 0:14

                   1111111111111111111
                111111111111111111111111
               111111111111111111111111111
              1111    11111111111111111111
              111      11111111111111111111
              1111    111111111111111111111
              11111111111111111111111111111
              11111111111111111111111111111
                            111111111111111
                            111111111111111
  11111111111111111111111111111111111111111 ***********
 111111111111111111111111111111111111111111 ************
1111111111111111111111111111111111111111111 *************
1111111111111111111111111111111111111111111 *************
1111111111111111111111111111111111111111111 *************
111111111111111111111111111111111111111111  *************
11111111111111111111111111111111111111111  **************
111111111111111111111111111111111111111   ***************
111111111111111111                      *****************
1111111111111111   **************************************
11111111111111  *****************************************
1111111111111  ******************************************
1111111111111 *******************************************
111111111111  *******************************************
111111111111  *******************************************
111111111111  *****************************************
 11111111111  *****************************************
    11111111  ***************************************
              **************
              *****************************
              *****************************
              *********************   *****
              ********************     ****
              ********************     ****
               ********************   *****
                *************************
                  *********************


[- Python -]
>http://www.python.org/

Friendly reminder that python is the top notch programming language
and has been heavily adopted by the industry and the academics.

Python has events and conferences all around the world:
>http://www.pycon.org/

Python even has a video repository!!
>http://pyvideo.org/

Find your local pythonistas group
>http://wiki.python.org/moin/LocalUserGroups

Join python and become a true computer scientist

Name: Anonymous 2013-10-03 0:14

I'm tinkering my stack-based reverse polish notation calculator written in Scheme. It has a nice interface for hard-coding in new functions quickly, but I can't find a good way to store session-specific functions. I have a built in variable assignment system though.

Example session:
[RPN]>> 10
(10)
[RPN]>> 20
(20 10)
[RPN]>> 30
(30 20 10)
[RPN]>> + +
(60)
[RPN]>> 10 +
(70)
[RPN]>> p
()
[RPN]>> 10 bind:a
(10)
[RPN]>> a 10 +
(20)
[RPN]>> QUIT

Name: Anonymous 2013-10-03 0:17

>>4
I had written a stack based reverse polish language in C once

But I think that in languages like that is very easy to fuck everything up

Name: Anonymous 2013-10-03 0:17

lel who even uses these shitty textboards

Name: Anonymous 2013-10-03 0:18

>>6
All the cool kids. Too bad moot had to ruin them.

Name: Anonymous 2013-10-03 0:20

>>6
I want an inline thread updating extension and I'm ok with it

Name: Anonymous 2013-10-03 0:21

>>5
I'm doing it in scheme right now (partially to learn scheme), it was fun but I don't really have much to do now.

Name: Anonymous 2013-10-03 0:22

>>8
I also want a post report capability

Name: Anonymous 2013-10-03 0:23

>>10
I also want a dubs checker.

Name: Anonymous 2013-10-03 0:23

>>9
I would be funny if you could call scheme functions from this

Name: Anonymous 2013-10-03 0:23

>>12
*it

Name: Anonymous 2013-10-03 0:26

I heard that Bjarne Stroustrup summon the devil to make the first C++ parser

Is that true?

Name: Anonymous 2013-10-03 0:30

>>12
That's exactly what I do, actually. I just pick the numbers on the stack and run the command on them, then put the result of that function call onto the stack.
Of course, it assumes you use numbers so things like string manipulation aren't possible (to be fair, putting something like that in a calculator would be bloat).

For example, this is a big list of functions that I put in the code.

(define functions
  (list
    (list "pi"    3.14159265359        0)
    (list "e"     2.71828182845        0)
    (list "id"    identity             1)
    (list "add1"  add1                 1)
    (list "sub1"  sub1                 1)
    (list "abs"   abs                  1)
    (list "cos"   cos                  1)
    (list "sin"   sin                  1)
    (list "tan"   tan                  1)
    (list "nl"    log                  1)
    (list "phi"   phi                  1)
    (list "sqrt"  sqrt                 1)
    (list "round" int-round            1)
    (list "+"     +                    2)
    (list "*"     *                    2)
    (list "/"     /                    2)
    (list "-"     -                    2)
    (list "**"    expt                 2)
    (list "ack"   ack                  2)
    (list "mod"   modulo               2)
    (list "gcd"   gcd                  2)
    (list "log"   log-b                2)))


The first member of every list is the string which is matched to the command run by the user. The second item of the list is either a value or a symbol which is assigned to a function (incidentally, you can use lambda expressions here, so add1 could be (lambda (x) (+ 1 x)) instead).

Adding a member to the list is the same as adding a new function, so if I wanted an add3 command, I could just add

(list "add3" (lambda (x) (+ 3 x) 1)

to the list and it'll work.

The third argument is the number of arguments needed for the function. So you can't do:
10 10 10 +
and expect to get thirty. A "function" with 0 arguments just puts the number onto the stack (useful for things like pi or e).

Name: Anonymous 2013-10-03 0:31

>>15
Nice!
Can you post source please?

Name: Anonymous 2013-10-03 0:36

>>16
Sure, but don't expect anything good. It's one of my first projects.
https://clbin.com/uXKPi
Feel free to do anything with it.

Name: Anonymous 2013-10-03 0:39

>>17
Thank you for sharing this!

Name: Anonymous 2013-10-03 0:41

>>18
No problem. To be honest I'm sort of flattered, this is the first time someone's expressed interest in my code.

Name: Anonymous 2013-10-03 0:45

>>19
:3

Name: Anonymous 2013-10-03 0:46

Just found that parsing XML is technically faster to parse than JSON

So we have: SExpr > XML > JSON

Name: Anonymous 2013-10-03 1:11

First for cute traps

Name: Anonymous 2013-10-03 1:59

Opinions about Tcl?

Name: Anonymous 2013-10-03 2:03

`
>using harmful programming languages
>2013

Name: Anonymous 2013-10-03 10:02

I'm thinking about killing myself.

Name: Anonymous 2013-10-03 10:04

>>25
Just do it faggot

Name: Anonymous 2013-10-03 10:18

I got 3 dubs on /g/ in less than 20 minutes

I posted total 7 posts

Name: Anonymous 2013-10-03 10:23

>>27
that's quite the feat

today must be your lucky day

Name: Anonymous 2013-10-03 10:29

>>28
One time I responded to a thread on /g/ and got quads without even trying.

It derailed the entire thread. Poor OP.

Name: Anonymous 2013-10-03 10:36

>>29
/g/ is the most epic place, man

Name: e/g/in 2013-10-03 10:41

xD

Name: e/g/in 2013-10-03 10:43

xDD

Name: Anonymous 2013-10-03 10:44

The sweet smell of dubs

<--- check 'em

Name: Anonymous 2013-10-03 10:45

>>30
You haven't seen real autism until you go to /jp/. Most of /g/ is pretty tame, except for the DPTs, which have become a hotspot for shitposting and language fanaticism.

Name: Anonymous 2013-10-03 10:48

>>34
I can say that the most people at /DPT/ are autists!

Name: Anonymous 2013-10-03 10:50

>>35
Concentrated autism

Name: Anonymous 2013-10-03 10:52

Very Concentrated autism

Name: Anonymous 2013-10-03 10:54

>>29
you know, that thread you responded to probably rubbed someone's autism the wrong way and they used your GET to derail it

dubs/quads/etc have become a destructive weapon against shitty threads on the imageboards

Name: Anonymous 2013-10-03 10:56

against shitty threads
Do you mean against threads whitch people don't like?

Name: Anonymous 2013-10-03 11:06

>>38
Not always. You see that more on /v/. Last I was there I saw someone doing it to a "gamer food" thread.

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