Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 395 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python vs. Ruby for metaprogramming

#21
I'm not sure that Python would fulfill all things you desire (especially the point about the minimal distinction between code and data), but there is one argument in favour of python. There is a project out there which makes it easy for you to program extensions for python in D, so you can have the best of both worlds.

[To see links please register here]

Reply

#22
You are describing Ruby.

> * Good metaprogramming. Ability to create classes, methods, functions,
> etc. at runtime. Preferably, minimal
> distinction between code and data,
> Lisp style.

It's very easy to extend *and* modify existing primitives at runtime. In ruby everything is an object, strings, integers, even functions.

You can also construct shortcuts for syntactic sugar, for example with [class_eval][1].

> * Nice, clean, sane syntax and consistent, intuitive semantics.
> Basically a well thought-out, fun to
> use, modern language.

Ruby follows the [principle of less surprise][2], and when comparing Ruby code vs the equivalent in other language many people consider it more "beautiful".

> * Multiple paradigms. No one paradigm is right for every project,
> or even every small subproblem within
> a project.

You can follow imperative, object oriented, functional and reflective.

> * An interesting language that actually affects the way one thinks
> about programming.

That's very subjective, but from my point of view the ability to use many paradigms at the same time allows for very interesting ideas.

I've tried Python and it doesn't fit your important points.

[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#23
Ruby is my choice after exploring Python, Smalltalk, and Ruby.
Reply

#24
For python-style syntax and lisp-like macros (macros that are real code) and good DSL see [converge](

[To see links please register here]

).
Reply

#25
Have you considered Smalltalk? It offers a very simple, clear and extensible syntax with reflectivity and introspection capabilities and a fully integrated development environment that takes advantage of those capabilities. Have a look at [some of the work being done][1] in [Squeak Smalltalk][2] for instance. A lot of researchers using Squeak hang out on the [Squeak mailing list][3] and #squeak on freenode, so you can get help on complex issues very easily.

Other indicators of its current relevance: it runs on any platform you'd care to name (including the [iPhone][4]); Gilad Bracha is basing his Newspeak work on Squeak; the V8 team cut their teeth on [Smalltalk VMs][5]; and Dan Ingalls and Randal Schwartz have recently returned to Smalltalk work after years in the wilderness.

Best of luck with your search - let us know what you decide in the end.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

[4]:

[To see links please register here]

[5]:

[To see links please register here]

Reply

#26
Your 4 "important" points lead to Ruby exactly, while the 2 "somewhat important" points ruled by Python. So be it.
Reply

#27
I am using Python for many projects and I think Python does provide all the features you asked for.

important:

1. Metaprogramming: Python supports metaclasses and runtime class/method generation etc
2. Syntax: Well thats somehow subjective. I like Pythons syntax for its simplicity, but some People complain that Python is whitespace-sensitive.
3. Paradigms: Python supports procedural, object-oriented and basic functional programming.
4. I think Python has a very practical oriented style, it was very inspiring for me.

Somewhat important:

1. Performance: Well its a scripting language. But writing C extensions for Python is a common optimization practice.
2. Documentation: I cannot complain. Its not that detailed as someone may know from Java, but its good enough.

As you are grad student you may want to read this paper claiming that [Python is all a scientist needs][1].
Unfortunately I cannot compare Python to Ruby, since I never used that language.

[1]:

[To see links please register here]


Regards,
Dennis

Reply

#28
If you like the lisp-style code-is-data concept, but don't like the Lispy syntax, maybe [Prolog][1] would be a good choice.


[1]:

[To see links please register here]


Whether that qualifies as a "fun to use, modern language", I'll leave to others to judge. ;-)

Reply

#29
There isn't really a lot to separate Python and Ruby. I'd say the Python community is larger and more mature than the Ruby community, and that's really important for me. Ruby is a more flexible language, which has positive and negative repercussions. However, I'm sure there will be plenty of people to go into detail on both these languages, so I'll throw a third option into the ring. How about JavaScript?

JavaScript was originally designed to be Scheme for the web, and it's prototype-based, which is an advantage over Python and Ruby as far as multi-paradigm and metaprogramming is concerned. The syntax isn't as nice as the other two, but it is probably the most widely deployed language in existence, and performance is getting better every day.
Reply

#30
There's not really a huge difference between python and ruby at least at an ideological level. For the most part, they're just different flavors of the same thing. Thus, I would recommend seeing which one matches your programming style more.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through