You are not logged in.

#26 2008-10-01 04:08:19

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: What language would suit someone who hates anything that isn't PHP?

dav7 wrote:

As promised...

A little simple at the moment, but it's the result of a dream... to create The Perfect Language

....

What do you think?

What language has the closest syntax as mine?

Is this language viable? Could it survive actually being developed? hmm

Please do let me know your opinions/comments/suggestions/flames. tongue

-dav7

How does your language make hard things easier? It doesn't seem to be bringing anything to the table but some arbitrary syntax (by which I mean that the syntax doesn't give you novel abilities like Lisp or Forth does). Seems pretty much like Javascript, actually.

You've got some legitimate gripes, such as compile time, excessive boilerplate, and perhaps case-sensitivity, but is it really worth making up and implementing a whole new language to get stuff like incremental compilation, case-insensitivity, dynamic typing, and a decent GUI library? Why not just pick a language that meets the rest of your needs, then write the library for it?

Okay, there's my opinion/comment/suggestion/flame. wink

Offline

#27 2008-10-01 04:15:12

somedrew
Member
From: Canada
Registered: 2007-05-14
Posts: 140

Re: What language would suit someone who hates anything that isn't PHP?

Just to put it out there and may not be as visually oriented as desired, but lolcode FTW smile

Offline

#28 2008-10-01 12:39:06

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: What language would suit someone who hates anything that isn't PHP?

pauldonnelly / everyone:

Well, I've been doing some thinking, and think that the past couple of days have been mostly filled with mixed emotions, as often happens when I try to learn C. I forget how hard I find memory management and just try to have a wild crack at getting over the initial hurdles, which ultimately doesn't end badly but in general wears me out mentally. So, at first I'm all like "yea, let's make a brand new language, and write the compiler in C", then I realize about all the memory stuff, and then I give up and [try not to] feel horrible about it, because C has pwned me yet again.

I see C as the ultimate in speed without any of what I see as difficulties - basically memory manipulation - and what I originally said about code to output ratio. I need to be able to type a really small amount of code (I don't mean that insanely - not something crazy like one line, maybe 50 to 80) to get the basics of a fairly stable, extensive application going, perhaps with a GUI, maybe with networking support, maybe with OpenGL or SDL. I could do that sort of thing with QuickBasic (for text-based applications at least), I could do it with VB 1.0, and to a fair extent, I can do it with PHP, although there are a few things that even with 1000 lines of code PHP fails epically.

I'm starting to see - or rather, comprehend - one of the bigger downfalls of PHP: its code to output ratio is diminutive.

When I talk about "code to output ratio", I describe whether a language uses "=" or ":=" to assign a variable. Whether a language requires me to define stuff before I use it. Whether a language has types or not, so I have the freedom to initialize something as an integer then later perform some kind of manipulation that leaves as a string. I'm an artist, not a code monkey; art is freeform, not calculated. Art is done on the spur of the moment, not after deliberation, and I need a language that doesn't define confinement, structure and calculation but rather defines freedom. I need a language that defines simplicty and only one sane way of doing something so I can concentrate on what I'm writing rather than on how to write it. I need a language that doesn't elaborate on the finer details of something but rather the whole picture. I want an expressive language that doesn't go over the top on punctuation or wording but at the same time is easily scannable.

Back to diminutive code/output, with PHP, I can create a one- or three-liner that will grab a webpage and do some string manipulations on it then output the contents. With file_get_contents(), I can get the contents of anything on the web, be it over HTTP, HTTPS, or FTP (provided the right extensions are loaded), without needing to worry about what's behind the scenes, and substr and strpos are great alternatives to regular expressions, if a bit lengthier to express.

PHP is great for small applications, but here's where the diminuendo of PHP comes into play: as an application or framework gets bigger, structure becomes progressively harder to control, and at the same time it becomes easier to write applications that require a lot of code be put into their source to make them "go". My best example of this is a PHP script that exceeds 2000 lines... and all it does is connects to an IRC network, or networks, and displays the contents of one or more channels in realtime, just like an IRC client would - formatted with coloring and all, with time/datestamping and everything. While all it'll do by itself is listen, it does have an event/callback system so it can be extended but my point is that it's 2k lines long and I just don't think that's good enough for something as simple as a text formatting system.

So I think what I'm looking for is a fast language with either a stable or incrementive code to output ratio: a language like this would be great for both small and large-scale applications, easy to write quick shell-executed hacks in, and easy to write IRC bots in, in maybe 800 lines or less.

What I'm looking for has to exist out there. What is it? hmm

-dav7


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#29 2008-10-01 12:39:53

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: What language would suit someone who hates anything that isn't PHP?

somedrew: Uhh... xD

-dav7


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#30 2008-10-01 15:44:21

gnud
Member
Registered: 2005-11-27
Posts: 182

Re: What language would suit someone who hates anything that isn't PHP?

Well, for easy GUI programming, QT fits the bill. It's a wonderful gui library with great performance and very advanced capabilities. It's native language is c++, and c++ is perhaps not the best language to "write quick shell-executed hacks in".

But fear not! QT has bindings to both python and Java (yes, java. You know that most of the useful stuff in PHP5 is straight from java?).

Python is the simpler of the two, but it seems that you for some reason love curly braces. So I suggest Java, with QT Jambi for GUI/animation (Look at http://doc.trolltech.com/4.4/qgraphicsscene.html).

Offline

#31 2008-10-01 16:11:55

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: What language would suit someone who hates anything that isn't PHP?

Hrm.

My requirements and expec--no, priorities, are still in a state of flux at the moment. I think what's happening is that I'm letting go of PHP smile

Right now, my focus isn't on whether a language has curly braces or not. It's on whether it compiles to fast-executing, cross-platform code, for example C.

I think I may accept not being able to use one language for everything, and may switch to and use multiple languages for different things, like I did for a little while with freeBASIC and PHP, until I got sick of the extra verbosity and limitedness of fB and switched entirely to PHP instead. For example, I might use Ruby and Shoes for desktop-centric scripts, Python for animation-oriented stuff, and something else when I want to write stuff that runs fast.

gnud, QT looks very interesting from an animation perspective, but that pointer-filled reference page does not. I will, however, keep graphicsscene in mind. I don't personally like Java, since it compiles to a VM, which I hear people say again and again is slow (especially Swing, and I admittedly like the look of the old version more in kind of a way, and not so much the new version). I also don't really like the sluggishness of Java in general myself, but when I get a faster computer I just might get into it one day. I'm learning to have an open mind with this programming thing wink

And wow, I certainly didn't know some of PHP5's better stuff came from Java. That's interesting to know, and might ease my transition big_smile

So, my current search is for a language that is easy to learn and generates code for the x86, ARM and MIPS achitectures, either directly or through a roundabout process such as generating of C code which is then compiled for the target platform. What do you recommend? Yes, tough ask, but what do you know, asking can sometimes reward tongue

Or, if that isn't possible, what languages come closest to that specification? Or what do you recommend I make my goals if I want a language that both doesn't use pointers but pushes my hardware to the limit?

-dav7


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#32 2008-10-01 18:09:31

gnud
Member
Registered: 2005-11-27
Posts: 182

Re: What language would suit someone who hates anything that isn't PHP?

Maybe pascal? IDK... I went straight to C when I grew tired of PHP myself smile

Check out http://www.freepascal.org/ and the tutorial at http://www.taoyue.com/tutorials/pascal/ to see if it looks interesting.

Offline

#33 2008-10-01 19:59:08

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: What language would suit someone who hates anything that isn't PHP?

Obviously, if you want speed then a compiled language is basically faster.  But does everything you write NEED that speed?  Python is an EXCELLENT choice of language to know and learn.  Heck, learn all the languages you can and use the best one for the job at hand.

I know C/C++, Python, PHP, ASP, VB and tons of other stuff.  Some thing I've learned in my 24 years of development is that you MUST:

1)  Keep it simple as it can be and still remain maintainable.  If you KNOW that this program is only going to do ONE thing for ONE MONTH, then get thrown away, don't waste the effort on C++ unless it is just totally easy.
2)  Cross platform is USUALLY easier with a non-compiled language.
3)  Speed is RELATIVE -- if you save 1 minute of a two minute job, you saved 50%, but if you shaved 20 seconds off a program that still takes an hour, you just wasted the dev time on the 20 second gain.
4)  Fit the language to the job!  NEVER underestimate the benefit of UNDERSTANDING what code does -- because you may have to com back to it after you've forgotten all about it.  For example, Python is usually much easier to understand than C++.  Python has little tricks that let you do things with it you'd be designing a week to implement in pure C++. Take advantage of a language when you can.

And on a personal note -- I absolutely hate VB.  Always have, always will.  (And I've spent most of the last 12 years being FORCED to use it!)

Last edited by mrunion (2008-10-01 20:00:56)


Matt

"It is very difficult to educate the educated."

Offline

#34 2008-10-01 21:05:02

Zeist
Arch Linux f@h Team Member
Registered: 2008-07-04
Posts: 532

Re: What language would suit someone who hates anything that isn't PHP?

As someone who works in software development and has learning programming languages as a hobby outside of work as well I am a bit skewed as for someone like me most languages are quite easily readable due to experience and that most languages are quite similar at their core.

I don't think that python is much more readable than C, especially the fact that indentation can make a big difference feels a bit quirky. Don't get me wrong, I actually like Python and for doing some things Python is absolutely unbeatable. I think you should at least look at Python and try it.

I would also recommend looking at Java, RubFit the language to the joby, C, C++, C# and Perl as they are all widely used and all have situations that they are the best choice in. In general I recommend looking at as many languages as possible as i find that in doing that one learns to more easily take the step away from thinking in a certain syntax and instead it allows you to more easily think in algorithms, data structures and data flow.

I think that the most important thing in general is, as mrunion put it: "Fit the language to the job". Select the language that is most suitable for the task rather than trying to bend the language you've decided on in advance to fit the task.


I haven't lost my mind; I have a tape back-up somewhere.
Twitter

Offline

#35 2008-10-01 21:31:10

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: What language would suit someone who hates anything that isn't PHP?

It doesn't look like anyone's suggested D yet. These threads come up all the time and eventually someone always suggests D. I haven't read all your requirements (or all the suggestions), but have a look here and see if it suits you:

http://d-programming-language.org/

Offline

#36 2008-10-02 09:18:51

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: What language would suit someone who hates anything that isn't PHP?

gnud:

I'm not sure about pascal. I tried it a long time ago - I tried Delphi actually - and it completely confused me. I could probably learn it now if I wanted to, but it doesn't have the right "feel" to me - at least, what that tutorial conveys doesn't (and I'm not downputting the tutorial, it expresses the language, not itself). Also, cool about PHP->C tongue


mrunion:

I agree that compiled languages are logically faster. And yes, I do need as much speed as possible, because I'm #1 a "fast" user and #2 I'm on a "slow" machine (slow being relative, 2.66GHz isn't slow but it's slow to me) tongue

Okay, I've actually been thinking of learning more than one language, although I don't know how my brain will handle that.

And...

1. I'll keep that in mind.
2. I'm starting to realize that... hmm
3. Right. But if you continually save speed, for example shave 2 seconds off a dialog open routine, that's an infinitesimal saving. Or, in my case, if I shave 90 microseconds off something, for example changing the background color of a button, or something like that, that's a huge saving to me. I recently got the idea to start guessing how many nested elements were in a webpage around a given link I was hovering over depending on how long it took for the hover state to change tongue
4. I do, I definately do. It's actually, from what I understand, what keeps me hung up on pointers. There are so many areas of disconnection in my brain I can't comprehend them.

And I do hate VB too, now that I've discovered PHP, which, while some have termed it the BASIC of the 21st century, is, IMHO, a few steps up.


Zeist:

Okay, that makes sense.

I agree about Python's readability - my first memory of Python was "this weird thing" that was included with StarOffice 5.1 - I remember looking at some Python code with, if I remember correctly, cat from a DOS prompt. I either closed the console or quickly 'cls'ed afterwards. neutral And yes, I've heard a few interesting things about Python such as its inclusion/support of getters/setters, which, as soon as I heard about these, perked up about.

I plan to inspect Java when I have a somewhat faster PC with more than 512MB RAM - Java tends to eat all my RAM up. C and C++ make me asplode mentally. Perl... is interesting, but nothing more at the moment. I also agree that knowing more languages should thoretically make one take a step away; in my case, I'll likely end up repeating what I did with PHP and VB, after PHP became my new favourite language: I built a mental PHP tokenizer on top of my VB understanding, and simply referred to that whenever I wanted to visualize how to design something. I still use it, and will continue to until I have a new favourite language (although I'm not actually writing stuff at the moment).

Actually, I'm planning on doing that! I'm composing a list of goals I want to be able to complete, and will submit this list to different forums (including this one) then learn the languages suggested from there, not ignoring the conversation I've already had here.


Dusty:
D. I've looked at D a little bit, in fact I was introduced to it by a friend. It seems a little iffy to me at the moment; I'd far prefer something that generated C or C-- code rather than native binary code, since C and C-- are mature, optimizing code compilers, and the second one is actually optimized for language output. However, I will have a look at it, as it does seem a little interesting, and might just work out for me in a few areas.

-dav7

Last edited by dav7 (2008-10-02 09:19:34)


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#37 2008-10-02 18:22:36

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: What language would suit someone who hates anything that isn't PHP?

dav7 wrote:

3. Right. But if you continually save speed, for example shave 2 seconds off a dialog open routine, that's an infinitesimal saving. Or, in my case, if I shave 90 microseconds off something, for example changing the background color of a button, or something like that, that's a huge saving to me. I recently got the idea to start guessing how many nested elements were in a webpage around a given link I was hovering over depending on how long it took for the hover state to change tongue

dav7 wrote:

D. I've looked at D a little bit, in fact I was introduced to it by a friend. It seems a little iffy to me at the moment; I'd far prefer something that generated C or C-- code rather than native binary code, since C and C-- are mature, optimizing code compilers, and the second one is actually optimized for language output. However, I will have a look at it, as it does seem a little interesting, and might just work out for me in a few areas.

You're way too hung up on this speed thing. 90 microseconds is a huge saving to you, on something you wouldn't ever do more than a few tens of times a second? That's not even a hundredth of a millisecond. And worrying about whether your compiler is as optimized as another is ludicrous unless you're actually crunching a phenomenal amount of numbers. Down this road lies nothing but obsessively misapplying C to every program you write.

Offline

#38 2008-10-02 18:30:50

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: What language would suit someone who hates anything that isn't PHP?

I kind of agree with pauldonnelly.  Obviously it's your choice what you want and you are free to do that, but trying to squeeze that minute amounts of speed for something beside writing collision detection implementations for LAN games or folding protiens or something is really misplaced effort is seems.

If you REALLY want speed, just skip on to machine code.  That's about as fast as you can get.  Besides, you mentioned cross-platform needs, so squeezing speed out of C is still leaving you at the mercy of the compiler(s) you end up using.  Without knowing machine code to check for optimized loops, etc., how are you sure that you are getting your effort's worth?

For a great many things Python/Perl/Java will do just fine AND be more mantainable and easier to add on to and change.

Again, these are just my opinions.


Matt

"It is very difficult to educate the educated."

Offline

#39 2008-10-03 05:42:51

scj
Member
From: Sweden
Registered: 2007-09-23
Posts: 158

Re: What language would suit someone who hates anything that isn't PHP?

FYI, real "artists" program in Lisp. cool

Offline

#40 2008-10-03 06:42:35

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: What language would suit someone who hates anything that isn't PHP?

pauldonnelly: Thanks for helping me notice that, now that I see things from a more generalized perspective, you're right. And I do indeed seem to have a obsessive, irrational desire to write everything I want to make "fast" in C... which is stupid, really.

mrunion: Okay, but what about animation? Interactive animation, to be precise.

everybody: Consider this for a moment. When we watch a DVD or supposedly "live" TV, we don't think about the fact that what we're watching is actually a few milliseconds "old". We see what we see when we see it, and as long as each consecutive frame is displayed with (give or take a few attoseconds) the same amount of time between frames, we see smooth animation and comprehend it to be timed at the point we see it. Even if CPU usage went up or down in a 6 second period during playback, or new bytes had to be fetched from disk, or something, as long as that task was done without affecting the real time clock or anything in between the RTC, the playback code and applicable hardware, it's all good.

Things get a little more tricky when it comes to interactive animation - in fact, computers are quite bad with animation that we might want to be able to interact with.

For example (and this is one of my many, many animation-related ideas), playing a movie that is composed of elements being rendered in realtime that allows for 360 degree playback angle modification in increments of half a degree, with freedom in all 3 axis - in other words, being able to pan and rotate around a playing scene with more agility than you get with today's DVDs or BD-DVDs which might boast inclusion 2 or 3 different angles for the movie - introduces the issue that the frames can't be delayed by a few milliseconds, or even half a second, as is how I'd imagine some DVD players "cheat" so they can use slower processors. Everything has to be realtime, since the developers don't know what angle will be being played back so can't pre-record and play the cached info back to you. Additionally, if you're going to want to be able to adjust the angle in realtime, the processor has to be able to run faster than realtime - ie, have the capacity to handle generation of the video stream twice or three times in one millisecond (or however short the developer wants the delay to be before the angle is actually changed), so the processor can generate the video stream and have room for the math routines that preprocess the 3D angle offsets.

Of course, the idea above is very futuristic and far-fetched, but it does illustrate my point.

A somewhat simpler example would be a screenshot taker that played back a 3D animation while taking the screenshot but integrated the screenshot image into the animation frames, something I'm definitely not going to know when writing the application. The underlying animation would need to be able to be either generated and played back in realtime very quickly with the screenshot image overlaid on top of the animation frames, or it'd need to be able to be partially rendered, with the screenshot overlaid on top of each frame either at once or in realtime, a process that would require heavy adherence to the real-time clock so that the screenshot overlay didn't desync with the underlying animation being played back. This might sound very easy to do but the actual animation I have planned is highly complex - I don't know if just it would be able to be played back by itself without chopping up!

These are the kinds of highly complex, advanced fields I want to get into as part of my life, and, yes, I want to be able to avoid C while I do it.

scj: Can Lisp do the above? Can it play sound? I know it can edit text, but that's very boring and industrial.

-dav7


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

#41 2008-10-05 05:23:11

xenobrain
Member
From: Lodi, CA
Registered: 2006-05-31
Posts: 91

Re: What language would suit someone who hates anything that isn't PHP?

I know I'm jumping into this a little late, but I suggest you take a look at Ultimate++

It's a very interesting project that helps you build gui apps quickly.

Last edited by xenobrain (2008-10-05 05:27:13)

Offline

#42 2008-10-05 08:14:55

JeremyTheWicked
Member
From: Poland
Registered: 2008-05-23
Posts: 193

Re: What language would suit someone who hates anything that isn't PHP?

dav7 - I don't get one thing. You told you wanted to "avoid maths". If you do - how are you planning to make this kind of complex animations you are talking about now? I can't imagine doing this kind of things with sheer image manipulation (like in VB). So: IMO you'll either have to dive into heavy mathematics OR, if you prefer to just manage boxes and stuff like you did in VB, you'll be perfectly fine using Python or whatever. Just my 2 cents.

Last edited by JeremyTheWicked (2008-10-05 08:16:19)


arch(3) adj amused because you think you understand something better than other people ;P

Offline

#43 2008-10-05 12:50:18

dav7
Member
From: Australia
Registered: 2008-02-08
Posts: 674

Re: What language would suit someone who hates anything that isn't PHP?

xenobrain: It looks really awesome, but it's C++-based. I mean, I don't even feel ready for (read: confident with) D yet, which doesn't even make [heavy] use of pointers, let alone C or C++!

JeremyTheWicked:
I plan to create these animations by some amazing feat that I have no idea about at the moment - probably several hugely roundabout methods that take a marginally longer time than using math would, but still work.

For example, a long time ago I wrote a function in PHP to scrmalbe wrdos wihle kepenig the fsrit and lsat chaarcrets (as wlel as pnucutioatn) itcnat (the saying is that if a words' first and last letters are intact, the word will still be recognized by the brain) and it took around 60 (I think 63 actually) lines of code for me to implement the punctuation-preserving algorithm. Upon showing my code to ##php on freenode one of the users there wrote a replacement function using a 313 byte regular expression. So that goes to show you that while my burgeoning, massively overwritten function was stupidly excessive and could be replaced with something <insert percentage I have no idea how to calculate here>% smaller, for the skill level I had at the time it worked just fine.

So, likewise, I'm sure that with several hundred (or maybe thousand) slow-rendering, basic image manipulations I can cobble together that make use of simple addition and subtraction, I just might be able to transfer what I see in my head to a video file I can send to a "real" developer, who can math-ify it up and take it from there. tongue

And now that I hear once again that Python can do what I want, yet again, hmm... tongue

-dav7

Last edited by dav7 (2008-10-05 12:51:44)


Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.

Offline

Board footer

Powered by FluxBB