dynamic-languages

What makes Ruby slow? [closed]

送分小仙女□ 提交于 2019-12-18 10:07:26
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . Ruby is slow at certain things. But what parts of it are the most problematic? How much does the garbage collector affect performance? I know I've had times when running the garbage collector alone took several seconds, especially when working with OpenGL libraries. I've used

Dynamic languages - which one should I choose?

情到浓时终转凉″ 提交于 2019-12-13 13:26:17
问题 Dynamic languages are on the rise and there are plenty of them: e.g. Ruby, Groovy, Jython, Scala (static, but has the look and feel of a dynamic language) etc etc. My background is in Java SE and EE programming and I want to extend my knowledge into one of these dynamic languages to be better prepared for the future. But which dynamic language should I focus on learning and why? Which of these will be the preferred language in the near future? 回答1: Learning Ruby or Python (and Scala to a

When are modules included in a Ruby class running in rails?

▼魔方 西西 提交于 2019-12-13 12:32:11
问题 I'm trying to write a method that tells me every class that includes a particular Module. It looks like this - def Rating.rateable_objects rateable_objects = [] ObjectSpace.each_object(Class) do |c| next unless c.include? Rateable rateable_objects << c end rateable_objects end Where "Rateable" is my module that I'm including in several models. What i'm finding is that this method return [] if i call it immediately after booting rails console or running the server. But if i first instantiate

Method resolution when using dynamic and handling of undefined method for specific derived class

只谈情不闲聊 提交于 2019-12-08 10:36:07
问题 Let's assume the following inheritance graph: A<-B<-C<-D<-E<-... (the inheritance tree is actually more complex than this example, and it contains hundreds of actual types). I do not own those types and have no control over their implementation Let's also assume a set of static methods: Handle(A a), Handle(B b), Handle(C c), Handle(D d) and so on. My current implementation of Handle(A a) "dispatches" to the desired method by using the dynamic keyword: public static void Handle(A a) { Handle(

How to use something similar to DynamicObject in Silverlight 3 / WP7?

故事扮演 提交于 2019-12-08 02:58:03
问题 How can you use Dynamic Language Runtime (DLR) or something else to mimic System.Dynamic.DynamicObject in SILVERLIGHT 3 (!) and WP7 (no C# 4.0!).. What I want to do is implement automatic dynamically created properties for databinding. 回答1: The DLR can be used with WP7. Iron Ruby supports Windows Phone 7 from version 1.1. DynamicObject was available as an extension prior to .Net 4.0 If you're happy using a language other than C# then this could be an option. There's a good article on using

Getting started programming in dynamic languages in Android ((J)Ruby, Clojure…)

混江龙づ霸主 提交于 2019-12-07 05:18:19
问题 I've been looking around, and I can't seem to find any definitive answer or headway that seems "up to date". I've seen some interesting projects like Mirah (formerly Duby), and am looking into it a bit. I've seen JRuby unsuccessfully used to compile ruby into .dex. I've also been looking, independently, into Clojure and have realized that they might all be linked to the same thing. Does anyone have any tips on how to get started and make headway? I ask not only what frameworks could help, but

How to use something similar to DynamicObject in Silverlight 3 / WP7?

醉酒当歌 提交于 2019-12-06 07:39:48
How can you use Dynamic Language Runtime (DLR) or something else to mimic System.Dynamic.DynamicObject in SILVERLIGHT 3 (!) and WP7 (no C# 4.0!).. What I want to do is implement automatic dynamically created properties for databinding. The DLR can be used with WP7. Iron Ruby supports Windows Phone 7 from version 1.1 . DynamicObject was available as an extension prior to .Net 4.0 If you're happy using a language other than C# then this could be an option. There's a good article on using IronRuby on Windows Phone 7 at http://msdn.microsoft.com/en-us/magazine/ff960707.aspx . As an alternative,

Getting started programming in dynamic languages in Android ((J)Ruby, Clojure…)

℡╲_俬逩灬. 提交于 2019-12-05 09:28:30
I've been looking around, and I can't seem to find any definitive answer or headway that seems "up to date". I've seen some interesting projects like Mirah (formerly Duby), and am looking into it a bit. I've seen JRuby unsuccessfully used to compile ruby into .dex. I've also been looking, independently, into Clojure and have realized that they might all be linked to the same thing. Does anyone have any tips on how to get started and make headway? I ask not only what frameworks could help, but more importantly, a philosophy/direction in which to guide my efforts, just to get started. dbyrne See

Dynamic languages for embedded devices? [closed]

ぃ、小莉子 提交于 2019-12-05 01:47:40
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . I need to deploy a dynamic language to a small embedded Linux device, and have difficulty finding the right one: I want to build a small web-application with this language (with a small framework like Sinatra or Camping ) and write some scripts for maintenance. I would prefer

How do I attach a method to a dynamically-created C# type at runtime?

感情迁移 提交于 2019-12-04 21:14:39
问题 I have been saddled with using an in-house data access library that is effectively XML passed to a stored procedure, which returns XML. There is nothing I can do about this. I tried to get ActiveRecord approved, but my request was declined. However, using the excellent code provided at http://blog.bodurov.com/Post.aspx?postID=27, I added an extension method to IEnumerable that converts the key-value pairs I make out of the ragged XML coming back into strongly typed objects, complete with