Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411281 Posts in 69324 Topics- by 58380 Members - Latest Member: bob1029

March 28, 2024, 09:34:30 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)TiBasic -> java/c
Pages: 1 [2]
Print
Author Topic: TiBasic -> java/c  (Read 9302 times)
dustin
Level 6
*


View Profile
« Reply #20 on: April 15, 2008, 05:42:21 PM »

Quote
That's pretty terse.  I guess it's a trade-off between flexibility and simplicity of the API.  Good food for thought.  It's dead simple, that's for sure!

Thanks, terse is what I was going for.  flexibility vs. simplicity is a good way to think about it.  I'm trying to go for simplicity in graphics sense if you couldn't tell Smiley .  Simple is what i'm going for so I can whip stuff out in as few lines as possible.

While this is limited in a graphics sense I don't think it limits game logic really.  I mean I can't really tell yet but from the simple games like this I've thought up it seems to work well over a wide variety of genres.  Of course i probably wouldn't want to do anything big with it.
Logged
Lukas
Level 3
***



View Profile
« Reply #21 on: April 16, 2008, 08:59:16 AM »

Quote
I have a moral obligation to save people from the tragedy that is a terrible programming language


Well... thanks for the feedback. So... why is my language so terrible?


I'd like to mention that you both, Martie and Dustin are programmers who already learned a higher programming language. Maybe you just can't emphatize in this situation and there is no reason to blame you for that. Every programmer I met so far didn't understand why I couldn't understand C++ or Java. They showed me how easy it is and they can't imagine how a language could possibly be easier.
After sentence two I couldn't catch up with their explanation anymore.
My language isn't called TiBasic, btw... Maybe you think it's horrible but if a Mercedes(new car) owner sees and old... Volkswagen and finds it horrible there is no reason to negate his opinion. He is right in every aspect and if he doesn't understand why someone wouldn't prefer a new car over this old Volkswagen there is no reason to blame him for it.
If my friend doesn't understand why he can't play the guitar and I can I won't understand him. I just don't see how it can be all that difficult to put a finger on that string. I show him how, put his finger on the string just like that but he won't be able to play the guitar anyway, afterwards.

My language focuses on one rule: "If the programme doesn't work the programmer will be able to fix the problem just by looking at the code. (without looking it up in a book)"
In advanced languages there are often some extra-rules, lots of different ways to use a command and believe it or not, that confused me because of all the brackets and points and commas....:

Code:
for i = 1, 100 * star_screens do
    local coord = {math.random(0, stars.w), math.random(0, stars.h)}
    stars[coord] = math.random(dgray, lgray)
  end

Some people are discouraged just by seeing such a thing. Really.

Of course you need all those complicated things for High-End-software because there are no ressources to waste. The Ti-Basic-interface allows the programmer to waste lots of Hz and mbRAM.

Also... My language isn't much more complicated than the original TI-Basic... and there are way more people who are able to programme with TiBasic than there are people who know how to use C. Every half-interested student who got an  TI-calculator in school learned TiBasic.

Please note: My language is not a thing for programmers or people who really want to learn C++ or something later. It's just a fun thing most people would be able to work with.
Also... even if none will ever be able to use this language... I give a f***.
For dustin it's a small project which allows him to improve his knowledge and skill and I will be happy programming with it when it's done. It will be the only language I'll ever really understand, I guess.


BaronCid
Logged

I make (60s/70s) rock music. Listen to my band's new album here: www.speicher.bandcamp.com
jcromartie
Level 0
***


View Profile
« Reply #22 on: April 16, 2008, 11:25:42 AM »

Quote
I have a moral obligation to save people from the tragedy that is a terrible programming language

Well... thanks for the feedback. So... why is my language so terrible?

Where to start?

Well, it has one thing going for it: case insensitivity.  That should be more common.

Other than that, um...  let's see.

* Special prefixes that indicate variables AND their types, reminiscent of Hungarian notation (the "tactical nuclear weapon of code obfuscation")

* Lines start with colons (why not just start them with the beginning of a line...?)

* Goto (increasingly obsolete since the '60s and '70s)

* No way to define functions (which are practically required for writing good code)

* Structures limited to 100 elements in a dimension for no good reason

* Assignment is "#" (?) and goes from left to right (??)

And, on top of those things there are more questions, like: can you indent code with that crazy colon syntax?  Or does everything have to be line up against the first position on the line?  Are there any restrictions on what list elements can be?

I have no problem with a simple system that anybody can work with.  That's great... but why make it painful for real programmers in the process?
« Last Edit: April 16, 2008, 11:27:21 AM by jcromartie » Logged
dustin
Level 6
*


View Profile
« Reply #23 on: April 16, 2008, 11:48:29 AM »

Quote
* Special prefixes that indicate variables AND their types, reminiscent of Hungarian notation (the "tactical nuclear weapon of code obfuscation")

* Lines start with colons (why not just start them with the beginning of a line...?)

* Goto (increasingly obsolete since the '60s and '70s)

* No way to define functions (which are practically required for writing good code)

* Structures limited to 100 elements in a dimension for no good reason

* Assignment is "#" (?) and goes from left to right (??)

Well at least  one of those is fixed...  The lines don't need to start with colons I just throw them out anyway Smiley
Also perl indicates both variable type and name and people like it ok
Also, there are functions although they arn't called functions.  They are called "subprograms" but they are really just plain old functions, they even use return.  Although truth be told I guess they can not take input parameters or return values so they are gimped functions.
Also indenting will be allowed of course
Logged
Lukas
Level 3
***



View Profile
« Reply #24 on: April 16, 2008, 01:53:40 PM »

Quote
Well, it has one thing going for it: case insensitivity.  That should be more common.
Since the language is so simple there is no need for case-sensitivity. Not if you want to get beginners frustrated when programming their first (and maybe last?) lines of code, at least.


Quote
Well at least  one of those is fixed...  The lines don't need to start with colons I just throw them out anyway
Please break that again. I stated it in my document so there is no need to fix it until the whole thing is done. The colons are there in TiBasic and I found them nice because you could write any crap into multiple lines without it being counted as a row of commands.
It could help people programming more complex programmes to keep their overview... example?

Code:
:if
(5=x)

//I use this space for writing some stuff down....
I can write as much stuff as I want to because everything between the "//" and the next colon wont be calculated.... I can split the commands aswell...

:[

:output
(
1,1,
"I use this line just for the text that's going to be displayed!"
)

:]

I'd find this comfortable.


Quote
* Goto (increasingly obsolete since the '60s and '70s)
Goto - I like to use it since 2004 - 96x64-1bit-display - increasingly obsolete since the '60s. Wink


Quote
* No way to define functions (which are practically required for writing good code)

If I told my friend "I'm going to make you now everything about this language in 30 minutes" and get to "functions" and how to define and use them... he would switch off after sentence 2. And he wouldn't stupid doing that. He is just no programmer. Subprogrammes are just like... lines of code except you don't have to write them into your actual code directly. You put them elsewere and make the programme refer to "elsewhere" (where those lines are) with an exec(name) command. It just helps advanced users to programme more complex programmes without loosing sight of all the things important.


Quote
Structures limited to 100 elements in a dimension for no good reason
a.) you don't have to define (and keep in mind) all the sizes of your structures.
if we wanted to, we could allow 1000 or 1337 elements in each dimension. which leads us to:
b.) I don't see why users would need a single structure bigger than 100x100 elements. Maybe you need one for player positions and one for pixeldata but that should be it. If you still need more... write a subprogramme and find a way. the machine won't complain.


Quote
* Assignment is "#" (?) and goes from left to right (??)

I just take the TI's logic: Defining variables is rather like "I put THIS into THAT" and not like "THAT has the value of THIS now". It's a more down-to-earth logic imo. Not better but suitable for non-programmers. Also, that Volkswagen over there is painted green (?) and has a white (??) steering wheel.

If you are used to using the good old "x = 5"-method and other conventions ... Why don't you just programme in the language you know? That's great! Why riding a bike if you can ride a motorcycle?


Quote
I have no problem with a simple system that anybody can work with.  That's great... but why make it painful for real programmers in the process?

Because programmers are on a much higher level already. They just don't need this language if they don't like it.
I can imagine riding a bike with training wheels must be pain in the a*** now... but back then they were the only things convincing me even to set a foot into that whole bycicle-riding-fuzz. :D


BaronCid

PS: I've found out that a pretty cool language I wanted to create already exists.
I wanted to make a powerful, fast, flexible, deep programming language without no useless knick-knack. Unfortunately someone already created it:
http://en.wikipedia.org/wiki/C%2B%2B

Did you try it out already? I think so.





Logged

I make (60s/70s) rock music. Listen to my band's new album here: www.speicher.bandcamp.com
dustin
Level 6
*


View Profile
« Reply #25 on: April 16, 2008, 02:12:43 PM »

Quote
Please break that again. I stated it in my document so there is no need to fix it until the whole thing is done. The colons are there in TiBasic and I found them nice because you could write any crap into multiple lines without it being counted as a row of commands.

uh... why?  You could still put the colons in if you want but I'm pretty sure I can swing it so the code you just listed would work with or without the colons. 

How about this if I find a way to do it without the colons I'll implement it but won't tell you so that way other people don't have to use them but you still can Smiley
Logged
jcromartie
Level 0
***


View Profile
« Reply #26 on: April 16, 2008, 07:28:24 PM »


Quote
* No way to define functions (which are practically required for writing good code)

If I told my friend "I'm going to make you now everything about this language in 30 minutes" and get to "functions" and how to define and use them... he would switch off after sentence 2. And he wouldn't stupid doing that. He is just no programmer.

Functions are also a familiar concept in mathematics.  Most people can grasp both functions and left-value assignment from the standard Algebra class "y = c*x + b" type examples.

Quote
I don't see why users would need a single structure bigger than 100x100 elements. ... If you still need more ... find a way. the machine won't complain.

It's silly to put arbitrary restrictions on the programmer like that.  Just because it sounds like enough?  That's not objective enough to make a decision.

Quote
Defining variables is rather like "I put THIS into THAT" and not like "THAT has the value of THIS now". It's a more down-to-earth logic imo. ... If you are used to using the good old "x = 5"-method and other conventions ... Why don't you just programme in the language you know?

In your opinion, yes, but not in the opinion of the creators of the *vast* majority of languages.  The only languages that I know of to use this sort of assignment are FORTRAN and TI-Basic.  There's a joke among programmers about how to "not write FORTRAN in any language."  Even languages with no assignment operator, like Lisp, use the left value as storage.

Code:
x = 5
x := 5
set x to 5
(setf x 5)
make "x 5

OK.  So is this sort of code better?



Code:
simplemode()

function init()
  y = 32
  rspeed = 0
  road_position = 32
  width = 20
  black()
  rect(0, road_position - width, 96, width * 2, white)
end

function draw()
  rect(9, y, 3, 3, white)  --  clear the old car position
 
  if keys.up then y = y - 1 end
  if keys.down then y = y + 1 end
  if keys.p then pause() end
 
  if not pxltest(12, y) or not pxltest(12, y + 2) then
    init()  --  we crashed the car
  end
 
  rect(10, y, 3, 3)  --  draw the car
 
  scroll(1, 0)
  rect(95, 0, 1, 64)
 
  if prob(0.1) then rspeed = rand(-1, 1) end -- change road direction
  if width > 2 and prob(0.025) then width = width - 1 end -- narrow road
 
  nextpos = road_position + rspeed
  if nextpos < 64 - width and nextpos > width then
    road_position = nextpos
  end
 
  rect(95, road_position - width, 1, width * 2, white)
end
Logged
dustin
Level 6
*


View Profile
« Reply #27 on: April 16, 2008, 11:12:22 PM »

Quote
OK.  So is this sort of code better?

are you talking to me or BaronCid for this last part and do you mean better then the pseudo code I posted earlier?  Because that was very rough I didn't even init variables or anything.  Also I love the screen shot what res is it in?
Logged
Hideous
That's cool.
Level 10
*****


3D models are the best


View Profile WWW
« Reply #28 on: April 16, 2008, 11:40:08 PM »

Cid, you're being an asshole, you know.
Logged

Lukas
Level 3
***



View Profile
« Reply #29 on: April 17, 2008, 02:46:26 AM »

Cid, you're being an asshole, you know.

I really hope that was supposed to be funny.


So having a clear vision and defending it makes people assholes from now on?
This means you have to be an asshole to achieve anything, I guess... I guess I guess I guess if you guess something else... you are right, I guess.

BaronCid
Logged

I make (60s/70s) rock music. Listen to my band's new album here: www.speicher.bandcamp.com
jcromartie
Level 0
***


View Profile
« Reply #30 on: April 17, 2008, 05:00:15 AM »

Quote
OK.  So is this sort of code better?

are you talking to me or BaronCid for this last part and do you mean better then the pseudo code I posted earlier?  Because that was very rough I didn't even init variables or anything.  Also I love the screen shot what res is it in?

I'm just talking to anybody who's interested.  Smiley

I was actually trying to implement your pseudocode, because it was a good example of the dead-simple type of API that TI-Basic presents.  Like I said... I love the idea of this low-fi gaming API.  I really need to build this for Windows.  It's on OS X right now, but designed to be 100% portable... I've even got the Windows/Linux conditional code in there already!

The resolution is 96x64.  There are 4 shades available, but the missing two are just between the two colors you see there.

Calling `simplemode()` at the beginning of the program directs all drawing to the screen instead of allowing you to draw to arbitrary surfaces.  It also hooks up key handling to not use the more complicated keymap/functional approach from the SHMUP example (as that requires a pretty good understanding of Lua/programming).

Oh, by the way...

Quote from: BaronCid
Also, that Volkswagen over there is painted green (?) and has a white (??) steering wheel.

I saw an old green Volkswagen broken down on the side of the freeway this morning!  And to continue the rapidly-deteriorating programming-language-as-car analogy:  I love older VWs (MkII/A2).  To me, C is like my old MkII Jetta.  It's light, pretty quick and powerful, doesn't have too many parts, and doesn't require a lot of fancy tools.  TI-Basic is like some bizarre old Russian car or something.  It is small and slow, the few components are oddly placed, and parts are pretty hard to come by.  Java is a big, heavy, modern car, where you can't tinker with anything under the hood because it's all electronically controlled so that you "don't have to worry about it" (even though it breaks anyway), and it's just not that fun to drive.
« Last Edit: April 17, 2008, 05:08:52 AM by jcromartie » Logged
Hideous
That's cool.
Level 10
*****


3D models are the best


View Profile WWW
« Reply #31 on: April 17, 2008, 05:10:57 AM »

Cid, you're being an asshole, you know.

I really hope that was supposed to be funny.


So having a clear vision and defending it makes people assholes from now on?
This means you have to be an asshole to achieve anything, I guess... I guess I guess I guess if you guess something else... you are right, I guess.

BaronCid

No, that's not what I meant. I mean you just sound like an asshole, like:

"Oh you wanna do that? YEAH WELL IT WAS MY IDEA SO I DECIDE".


That's how it sounds anyway.
Logged

jcromartie
Level 0
***


View Profile
« Reply #32 on: April 17, 2008, 05:17:08 AM »

like:

"Oh you wanna do that? YEAH WELL IT WAS MY IDEA SO I DECIDE".

That's what he's saying, but to be fair I just came along and hijacked the whole thing anyway.  I'm butting in with my experience as a programmer, but I can see why it's not welcome.  I mean, even if it's ugly, it's still his baby.  I'll stick a new thread up with my little toy and see if anybody likes it, and let BaronCid and dustin work it out between themselves.
Logged
joshg
Level 4
****



View Profile WWW
« Reply #33 on: April 17, 2008, 06:39:07 AM »

PS: I've found out that a pretty cool language I wanted to create already exists.
I wanted to make a powerful, fast, flexible, deep programming language without no useless knick-knack. Unfortunately someone already created it:
http://en.wikipedia.org/wiki/C%2B%2B

Oh don't worry, C++ has useless knick-knacks all over the place.  Smiley

For what it's worth, while I think it's cool to just wing it and make the language you want, I think in the end it'll have to be simply because it's what you want to use.  Arguing that it's better or worse for non-programmers is, well iffy.  I've seen a class full of people who have never touched programming before learn how to handle functions, Java-style syntax and the like with a very simple introduction.

(Of course, it was Processing, which is basically the Best Language/IDE Ever for learning how to program for the first time.)

If your syntax ideas have a history from TI/Basic or whatever, though, and you want to use them, go for it.  Also, post some source code here once it's working!  All of us "real programmers" will be better off having to stretch our code-linguistics by trying to understand something radically different than the usual C-style syntax.
Logged

these are from an actual radio shack in the ghetto
dustin
Level 6
*


View Profile
« Reply #34 on: April 17, 2008, 09:14:05 AM »

Quote
I'm just talking to anybody who's interested.  Smiley

I was actually trying to implement your pseudocode, because it was a good example of the dead-simple type of API that TI-Basic presents.  Like I said... I love the idea of this low-fi gaming API.  I really need to build this for Windows.  It's on OS X right now, but designed to be 100% portable... I've even got the Windows/Linux conditional code in there already!

Ok cool I would love to see it, it's lua though right?  Not sure I have time to learn a new language at the moment.  Just making sure you didn't think my pseudocode was ugly or something Smiley  I'm trying to implement it at the moment as well...

Oh but I think java is fun... Smiley
Logged
dustin
Level 6
*


View Profile
« Reply #35 on: April 20, 2008, 09:46:34 AM »

ok I have all the put pixel commands except drawing text done now so I'm pretty close to having a rough finished copy.
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic