Re: Momentary Eh?! for a Dynamic Language Programmmer. Tuples vs Arrays. Just rambling.

2014-06-25 Thread Chris Williams via Digitalmars-d-learn
On Monday, 23 June 2014 at 22:08:59 UTC, John Carter wrote: On Monday, 23 June 2014 at 21:26:19 UTC, Chris Williams wrote: More likely what you want are variants: Hmm. Interesting. Yes, Variant and VariantArray are much closer to the dynamic language semantics... But the interesting

Momentary Eh?! for a Dynamic Language Programmmer. Tuples vs Arrays. Just rambling.

2014-06-23 Thread John Carter via Digitalmars-d-learn
I guess between perl and Ruby and Scheme etc. I got used to creating hybrid containers Want a pair of [string, fileList]? Just make an Array with two items, one a string, one and array of strings. Done. D barfed... leaving me momentarily stunned... then Oh Yes, type safety, Tuple's are

Re: Momentary Eh?! for a Dynamic Language Programmmer. Tuples vs Arrays. Just rambling.

2014-06-23 Thread Chris Williams via Digitalmars-d-learn
On Monday, 23 June 2014 at 21:18:39 UTC, John Carter wrote: I guess between perl and Ruby and Scheme etc. I got used to creating hybrid containers Want a pair of [string, fileList]? Just make an Array with two items, one a string, one and array of strings. Done. D barfed... leaving me

Re: Momentary Eh?! for a Dynamic Language Programmmer. Tuples vs Arrays. Just rambling.

2014-06-23 Thread Ary Borenszweig via Digitalmars-d-learn
On 6/23/14, 6:18 PM, John Carter wrote: I guess between perl and Ruby and Scheme etc. I got used to creating hybrid containers Want a pair of [string, fileList]? Just make an Array with two items, one a string, one and array of strings. Done. D barfed... leaving me momentarily stunned...

Re: Momentary Eh?! for a Dynamic Language Programmmer. Tuples vs Arrays. Just rambling.

2014-06-23 Thread bearophile via Digitalmars-d-learn
Ary Borenszweig: As a library solution I would do something like this: Union!(int, string)[] elements; elements ~= 1; elements ~= hello; Take a look at Algebraic in Phobos. Bye, bearophile

Re: Momentary Eh?! for a Dynamic Language Programmmer. Tuples vs Arrays. Just rambling.

2014-06-23 Thread John Carter via Digitalmars-d-learn
On Monday, 23 June 2014 at 21:26:19 UTC, Chris Williams wrote: More likely what you want are variants: Hmm. Interesting. Yes, Variant and VariantArray are much closer to the dynamic language semantics... But the interesting thing is Tuple is much closer to What I Mean when I create

Re: Momentary Eh?! for a Dynamic Language Programmmer. Tuples vs Arrays. Just rambling.

2014-06-23 Thread Meta via Digitalmars-d-learn
On Monday, 23 June 2014 at 22:11:57 UTC, John Carter wrote: On Monday, 23 June 2014 at 21:49:29 UTC, Ary Borenszweig wrote: Union types are very common (I use them every day), and IMHO it's very nice to have them included in the language (either built-in or as a library solution). As a

Re: Dynamic language

2012-03-16 Thread so
On Thursday, 15 March 2012 at 22:51:57 UTC, H. S. Teoh wrote: It can also be a security concern. Somebody could offer players an awesome script in DLL form that actually contains arbitrary exploit code. Or a script that contains D code for an exploit. If you are compiling at runtime you can

Re: Dynamic language

2012-03-16 Thread so
On Thursday, 15 March 2012 at 22:37:12 UTC, Manu wrote: Do you expect users to be modifying the scripts in the retail release? Surely scripting is still for what it has always been for, rapid iteration/prototyping during development. You need to be able to do both. You only need the

Re: Dynamic language

2012-03-16 Thread Paulo Pinto
That is the reason why managed environments with JIT are so popular, you get the best of both worlds. Andrei Alexandrescu wrote in message news:jjtiu8$1ucs$1...@digitalmars.com... On 3/15/12 3:12 PM, Nick Sabalausky wrote: Anything an interpreter can do, a compiler can do. And dynamic

Re: Dynamic language

2012-03-16 Thread Paulo Pinto
To be fair Python is not alone, all the ML languages (Ocaml, Haskell, F#, ...) also work that way. F# was even funnier. While the language was experimental the default mode was still like most languages, and a #light mode was available, similar to what ML-like languages have. Due to the

Re: Dynamic language

2012-03-16 Thread F i L
Adam D. Ruppe wrote: import std.variant; struct Extendable { Variant[string] properties; Variant opDispatch(string name)() { return properties[name]; } Variant opDispatch(string name, T)(T t) { properties[name] = t; return properties[name]; } } void

Re: Dynamic language

2012-03-16 Thread F i L
On Friday, 16 March 2012 at 07:48:19 UTC, so wrote: On Thursday, 15 March 2012 at 22:37:12 UTC, Manu wrote: Do you expect users to be modifying the scripts in the retail release? Surely scripting is still for what it has always been for, rapid iteration/prototyping during development. You

Re: Dynamic language

2012-03-16 Thread Boscop
On Friday, 16 March 2012 at 09:12:57 UTC, F i L wrote: Alright I give up dammit! How do you use opCall() to make a.cool() work? How would it be possible, the type of the delegate can't be typechecked at the call-site, because the type info is lost in the variant. And you can't exhaustively

Re: Dynamic language

2012-03-16 Thread Adam D. Ruppe
On Friday, 16 March 2012 at 09:12:57 UTC, F i L wrote: Alright I give up dammit! How do you use opCall() to make a.cool() work? I was a little unclear... but you'll have to modify std.variant and/or wrap it. Here's a solution that wraps it: == import std.traits; import std.variant; // we

Re: Dynamic language

2012-03-16 Thread Simon
On 16/03/2012 02:28, Nick Sabalausky wrote: James Millerja...@aatch.net wrote in message news:mailman.733.1331853568.4860.digitalmar...@puremagic.com... I hate the fact that Flash games are created the way they are. For one, it's impenetrable to try and learn properly, I had so much trouble

Re: Dynamic language

2012-03-16 Thread Nick Sabalausky
Simon s.d.hamm...@gmail.com wrote in message news:jk053b$sg0$1...@digitalmars.com... On 16/03/2012 02:28, Nick Sabalausky wrote: James Millerja...@aatch.net wrote in message news:mailman.733.1331853568.4860.digitalmar...@puremagic.com... I hate the fact that Flash games are created the way

Re: Dynamic language

2012-03-16 Thread F i L
On Friday, 16 March 2012 at 14:23:20 UTC, Adam D. Ruppe wrote: On Friday, 16 March 2012 at 09:12:57 UTC, F i L wrote: Alright I give up dammit! How do you use opCall() to make a.cool() work? I was a little unclear... but you'll have to modify std.variant and/or wrap it. Here's a solution

Re: Dynamic language

2012-03-16 Thread Adam D. Ruppe
On Friday, 16 March 2012 at 22:48:44 UTC, F i L wrote: Yes it does. I'm sure it wont be too long before all this stuff is fixed up a bit. Aye. I just sent a pull request for the minor std.variant thing (so strings can be converted to ints - we can do weak typing more easily now if we want).

Re: Dynamic language

2012-03-16 Thread Adam D. Ruppe
On Friday, 16 March 2012 at 11:22:07 UTC, Boscop wrote: How would it be possible, the type of the delegate can't be typechecked at the call-site, because the type info is lost in the variant. The trick is to build wrapper functions at the assignment point, where you still have all the type

Re: Dynamic language

2012-03-16 Thread bearophile
so: Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one? To give you an idea what i am after: Of all one-liners i have heard only

Re: Dynamic language

2012-03-16 Thread Danni Coy
I mostly do game scripting -- and there are quite a few features in D that I would like access to. Python would be my goto dynamic language mostly because a lot of the applications I use are either partially written in it or can be scripted easily using it. Also it is quite an enjoyable language

Dynamic language

2012-03-15 Thread so
Hello, Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one? To give you an idea what i am after: Of all one-liners i have heard only one

Re: Dynamic language

2012-03-15 Thread F i L
On Thursday, 15 March 2012 at 07:09:39 UTC, so wrote: Hello, Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one? To give you an idea

Re: Dynamic language

2012-03-15 Thread Paulo Pinto
cases. -- Paulo so wrote in message news:uamqdkmnshxmvayeu...@forum.dlang.org... Hello, Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one

Re: Dynamic language

2012-03-15 Thread Paulo Pinto
but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one? To give you an idea what i am after: Of all one-liners i have heard only one gets me. The programmable programming

Re: Dynamic language

2012-03-15 Thread bls
On 03/15/2012 12:09 AM, so wrote: Hello, Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one? To give you an idea what i am after: Of all

Re: Dynamic language

2012-03-15 Thread Jacob Carlborg
On 2012-03-15 08:09, so wrote: Hello, Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one? To give you an idea what i am after: Of all one

Re: Dynamic language

2012-03-15 Thread Michal Minich
http://rigaux.org/language-study/scripting-language/

Re: Dynamic language

2012-03-15 Thread Ary Manzana
On 3/15/12 4:09 AM, so wrote: Hello, Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one? To give you an idea what i am after: Of all one

Re: Dynamic language

2012-03-15 Thread Jesse Phillips
On Thursday, 15 March 2012 at 07:09:39 UTC, so wrote: Hello, Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one? To give you an idea

Re: Dynamic language

2012-03-15 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 03:27:32PM +0100, Jesse Phillips wrote: On Thursday, 15 March 2012 at 07:09:39 UTC, so wrote: Hello, Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure

Re: Dynamic language

2012-03-15 Thread Andrei Alexandrescu
On 3/15/12 3:58 AM, F i L wrote: Not really a help to you, but I honestly have no idea why people *want* to use dynamic programming languages. There is very little benefit I see in having your core object structure be complete dynamic. I remember watching this Google tech talk awhile ago, about

Re: Dynamic language

2012-03-15 Thread Adam D. Ruppe
On Thursday, 15 March 2012 at 07:09:39 UTC, so wrote: I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one? D! I'm not kidding... let's look at a list of things you might want: * You mentioned lisp. One of the cooler things

Re: Dynamic language

2012-03-15 Thread Adam D. Ruppe
On Thursday, 15 March 2012 at 07:09:39 UTC, so wrote: If so Lisp will be my first choice. I just talked about D because D rox, but if you are doing it for education, Lisp is a good choice because it is fairly unique. For real jobs, I'd go with D or maybe Javascript if I wanted scripting.

Re: Dynamic language

2012-03-15 Thread so
Thank you all! On Thursday, 15 March 2012 at 17:30:49 UTC, Adam D. Ruppe wrote: On Thursday, 15 March 2012 at 07:09:39 UTC, so wrote: If so Lisp will be my first choice. I just talked about D because D rox, but if you are doing it for education, Lisp is a good choice because it is fairly

Re: Dynamic language

2012-03-15 Thread Manu
On 15 March 2012 20:59, so s...@so.so wrote: Thank you all! On Thursday, 15 March 2012 at 17:30:49 UTC, Adam D. Ruppe wrote: On Thursday, 15 March 2012 at 07:09:39 UTC, so wrote: If so Lisp will be my first choice. I just talked about D because D rox, but if you are doing it for

Re: Dynamic language

2012-03-15 Thread Nick Sabalausky
so s...@so.so wrote in message news:uamqdkmnshxmvayeu...@forum.dlang.org... Hello, Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one

Re: Dynamic language

2012-03-15 Thread Nick Sabalausky
all over the gaming industry because it's fast and integrates with C very easily. Personally, I don't like it because it *is* a dynamic langauge. But if you're looking for a dynamic language, well, then there's that. Back in the 90's, the game Abuse famously had all its gameplay code written

Re: Dynamic language

2012-03-15 Thread so
On Thursday, 15 March 2012 at 19:25:24 UTC, Nick Sabalausky wrote: so s...@so.so wrote in message news:uamqdkmnshxmvayeu...@forum.dlang.org... Hello, Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic

Re: Dynamic language

2012-03-15 Thread so
. But if you're looking for a dynamic language, well, then there's that. Not just because i am looking for, how would you code a customizable ui (wow ui for example) without an interpreter? You got no other options AFAIK when it comes to customizable stuff.

Re: Dynamic language

2012-03-15 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 09:15:34PM +0200, Manu wrote: On 15 March 2012 20:59, so s...@so.so wrote: [...] On Thursday, 15 March 2012 at 17:30:49 UTC, Adam D. Ruppe wrote: [...] I just talked about D because D rox, but if you are doing it for education, Lisp is a good choice because it is

Re: Dynamic language

2012-03-15 Thread Nick Sabalausky
very easily. Personally, I don't like it because it *is* a dynamic langauge. But if you're looking for a dynamic language, well, then there's that. Not just because i am looking for, how would you code a customizable ui (wow ui for example) without an interpreter? You got no other options

Re: Dynamic language

2012-03-15 Thread Nick Sabalausky
H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.709.1331842273.4860.digitalmar...@puremagic.com... On Thu, Mar 15, 2012 at 09:15:34PM +0200, Manu wrote: On 15 March 2012 20:59, so s...@so.so wrote: [...] On Thursday, 15 March 2012 at 17:30:49 UTC, Adam D. Ruppe wrote: [...]

Re: Dynamic language

2012-03-15 Thread Andrei Alexandrescu
On 3/15/12 3:12 PM, Nick Sabalausky wrote: Anything an interpreter can do, a compiler can do. And dynamic typing doesn't have anything to do with interpreted vs compiled anyway. Generating and running code during runtime is often easier in interpreted environments. Andrei

Re: Dynamic language

2012-03-15 Thread Jesse Phillips
On Thursday, 15 March 2012 at 14:55:20 UTC, H. S. Teoh wrote: Bash?? Are you serious?! It is terrible as a programming language, I will give you that. But in terms of something useful to learn, it has been. But I would say if it is going to take up more than a screen (terminal size) then

Re: Dynamic language

2012-03-15 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 03:24:24PM -0400, Nick Sabalausky wrote: [...] - If you can stomach the indent-scoping, Python is very well-regarded and has a lot of fancy advanced features. I used to despise Python's indent-scoping too, though since then I've had some opportunity to use Python for

Re: Dynamic language

2012-03-15 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 04:13:42PM -0400, Nick Sabalausky wrote: H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.709.1331842273.4860.digitalmar...@puremagic.com... On Thu, Mar 15, 2012 at 09:15:34PM +0200, Manu wrote: On 15 March 2012 20:59, so s...@so.so wrote: [...]

Re: Dynamic language

2012-03-15 Thread James Miller
On 16 March 2012 09:38, H. S. Teoh hst...@quickfur.ath.cx wrote: (P.S. From what I heard, Lisp trumps D in metaprogramming abilities, but I don't know Lisp so I can't comment on that.) Greenspun's Tenth Law states that any time a programming language adds a new feature, it moves closer to

Re: Dynamic language

2012-03-15 Thread Steven Schveighoffer
On Thu, 15 Mar 2012 03:09:37 -0400, so s...@so.so wrote: Hello, Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one? To give you

Re: Dynamic language

2012-03-15 Thread J Arrizza
Ruby, hands down. - Strong OO language. I believe it was partially based on smalltalk. - The Object model is very well done, every thing is a first-class object. - Meta-programming is easy to do - has good support in IDEs like eclipse and RubyMine - the gem library is huge and comprehensive -

Re: Dynamic language

2012-03-15 Thread James Miller
On 16 March 2012 04:28, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: Relevant insight: http://existentialtype.wordpress.com/2011/03/19/dynamic-languages-are-static-languages/ Andrei That was a cool article. The comments are amusing, all the people not really understanding the

Re: Dynamic language

2012-03-15 Thread F i L
Paulo Pinto wrote: The main benefit dynamic languages bring to the table is not requiring to write types everywhere, duck typing, and the flexibility metaprogramming has. I'll give you the metaprogramming bit, but duck-typing is rarely a benefit over languages, like D and C#, which support

Re: Dynamic language

2012-03-15 Thread Nick Sabalausky
H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.713.1331843912.4860.digitalmar...@puremagic.com... On Thu, Mar 15, 2012 at 04:13:42PM -0400, Nick Sabalausky wrote: H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.709.1331842273.4860.digitalmar...@puremagic.com...

Re: Dynamic language

2012-03-15 Thread Brad Anderson
On Thu, Mar 15, 2012 at 3:56 PM, F i L witte2...@gmail.com wrote: Paulo Pinto wrote: The main benefit dynamic languages bring to the table is not requiring to write types everywhere, duck typing, and the flexibility metaprogramming has. I'll give you the metaprogramming bit, but

Re: Dynamic language

2012-03-15 Thread Manu
On 15 March 2012 22:12, H. S. Teoh hst...@quickfur.ath.cx wrote: On Thu, Mar 15, 2012 at 09:15:34PM +0200, Manu wrote: On 15 March 2012 20:59, so s...@so.so wrote: [...] On Thursday, 15 March 2012 at 17:30:49 UTC, Adam D. Ruppe wrote: [...] I just talked about D because D rox, but if

Re: Dynamic language

2012-03-15 Thread James Miller
On 16 March 2012 11:37, Manu turkey...@gmail.com wrote: Do you expect users to be modifying the scripts in the retail release? Surely scripting is still for what it has always been for, rapid iteration/prototyping during development. Hot-plugging DLL's written in D sounds pretty interesting to

Re: Dynamic language

2012-03-15 Thread F i L
Brad Anderson wrote: Got a score of 292 while spending most of the time with just a sliver of life. Those sneaky health powerups kept getting knocked off the screen before they'd reach me. Fun though. Regards, Brad Anderson Ha! I once got a score of ~1,200 on my Tablet. You get more

Re: Dynamic language

2012-03-15 Thread Derek Parnell
On Thu, 15 Mar 2012 18:09:37 +1100, so s...@so.so wrote: Hello, Not related to D but this is a community which i can find at least a few objective person. I want to invest some quality time on a dynamic language but i am not sure which one. Would you please suggest one? To give you

Re: Dynamic language

2012-03-15 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 06:15:39PM -0400, Nick Sabalausky wrote: H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.713.1331843912.4860.digitalmar...@puremagic.com... On Thu, Mar 15, 2012 at 04:13:42PM -0400, Nick Sabalausky wrote: H. S. Teoh hst...@quickfur.ath.cx wrote in

Re: Dynamic language

2012-03-15 Thread Nick Sabalausky
H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.712.1331843803.4860.digitalmar...@puremagic.com... On Thu, Mar 15, 2012 at 03:24:24PM -0400, Nick Sabalausky wrote: [...] - If you can stomach the indent-scoping, Python is very well-regarded and has a lot of fancy advanced

Re: Dynamic language

2012-03-15 Thread James Miller
On 16 March 2012 12:05, Nick Sabalausky a@a.a wrote: H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.712.1331843803.4860.digitalmar...@puremagic.com... On Thu, Mar 15, 2012 at 03:24:24PM -0400, Nick Sabalausky wrote: [...] - If you can stomach the indent-scoping, Python is

Re: Dynamic language

2012-03-15 Thread Nick Sabalausky
H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.730.1331851930.4860.digitalmar...@puremagic.com... On Thu, Mar 15, 2012 at 06:15:39PM -0400, Nick Sabalausky wrote: H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.713.1331843912.4860.digitalmar...@puremagic.com...

Re: Dynamic language

2012-03-15 Thread Nick Sabalausky
James Miller ja...@aatch.net wrote in message news:mailman.733.1331853568.4860.digitalmar...@puremagic.com... I hate the fact that Flash games are created the way they are. For one, it's impenetrable to try and learn properly, I had so much trouble figuring out how to do things properly, you

Re: Dynamic language

2012-03-15 Thread H. S. Teoh
On Thu, Mar 15, 2012 at 09:50:30PM -0400, Nick Sabalausky wrote: H. S. Teoh hst...@quickfur.ath.cx wrote in message news:mailman.730.1331851930.4860.digitalmar...@puremagic.com... [...] Oh, I wasn't worried about the licensing part. It's more about needing to ship dmd + druntime sources

Re: Dynamic language

2012-03-15 Thread Nick Sabalausky
Derek Parnell ddparn...@bigpond.com wrote in message news:op.wa8hg1dimqne79@derrick-pc.spareco.local... For a programmable language, you might want to look at Forth. I use it as an embedded scripting language in a couple of my programs. Forth is one of those rare ones that seems to be both

Re: Dynamic language

2012-03-15 Thread Nick Sabalausky
Adam D. Ruppe destructiona...@gmail.com wrote in message news:bighgnfjujyisywpc...@forum.dlang.org... import std.variant; struct Extendable { Variant[string] properties; Variant opDispatch(string name)() { return properties[name]; } Variant opDispatch(string name,