Razlika između inačica stranice »Ruby (programski jezik)«

Izvor: Hrvatska internetska enciklopedija
Skoči na:orijentacija, traži
m (Bot: Automatska zamjena teksta (-{{cite book +{{Citiranje knjige))
m (file->datoteka)
 
(Nije prikazana jedna međuinačica istog suradnika)
Redak 3: Redak 3:
{{Infookvir programski jezik
{{Infookvir programski jezik
|ime = Ruby
|ime = Ruby
|logo = [[File:Ruby logo.svg|frameless|100px]]
|logo = [[Datoteka:Ruby logo.svg|frameless|100px]]
|paradigma = više paradigmi: objektno orijentirani, imperativni, [[funkcijsko programiranje|funkcijski]], refleksivni
|paradigma = više paradigmi: objektno orijentirani, imperativni, [[funkcijsko programiranje|funkcijski]], refleksivni
|godina = 1995.
|godina = 1995.
Redak 38: Redak 38:
</ref>
</ref>
|utjecao_na = [[Clojure]], [[D (programming language)|D]],<ref>[http://www.digitalmars.com/d/1.0/ Intro – D Programming Language 1.0 – Digital Mars]</ref> [[Elixir (programming language)|Elixir]], [[Falcon (programming language)|Falcon]], [[Fancy (programming language)|Fancy]],<ref>
|utjecao_na = [[Clojure]], [[D (programming language)|D]],<ref>[http://www.digitalmars.com/d/1.0/ Intro – D Programming Language 1.0 – Digital Mars]</ref> [[Elixir (programming language)|Elixir]], [[Falcon (programming language)|Falcon]], [[Fancy (programming language)|Fancy]],<ref>
{{cite web
{{Citiranje web
   | url=http://rubini.us/2011/02/23/introduction-to-fancy/
   | url=http://rubini.us/2011/02/23/introduction-to-fancy/
   | title=Introduction to Fancy
   | title=Introduction to Fancy
Redak 48: Redak 48:
   | accessdate=2011-07-21}}
   | accessdate=2011-07-21}}
</ref> [[Groovy (programming language)|Groovy]], [[Ioke (programming language)|Ioke]],<ref>
</ref> [[Groovy (programming language)|Groovy]], [[Ioke (programming language)|Ioke]],<ref>
{{cite web
{{Citiranje web
   | url=http://ioke.org/
   | url=http://ioke.org/
   | title=Ioke
   | title=Ioke
Redak 57: Redak 57:
   | quote=inspired by Io, Smalltalk, Lisp and Ruby}}
   | quote=inspired by Io, Smalltalk, Lisp and Ruby}}
</ref> [[Mirah (programming language)|Mirah]], [[Nu (programming language)|Nu]],<ref>
</ref> [[Mirah (programming language)|Mirah]], [[Nu (programming language)|Nu]],<ref>
{{cite web
{{Citiranje web
   | url=http://programming.nu/about
   | url=http://programming.nu/about
   | title=About Nu™
   | title=About Nu™
Redak 65: Redak 65:
   | publisher=Neon Design Technology, Inc.
   | publisher=Neon Design Technology, Inc.
   | accessdate=2011-07-21}}
   | accessdate=2011-07-21}}
</ref> [[Potion (programming language)|potion]], [[Reia (programming language)|Reia]], [[Swift (Apple programming language)|Swift]]<ref name="lattner2014">{{cite web|url=http://nondot.org/sabre/|title=Chris Lattner's Homepage|last=Lattner|first=Chris|date=2014-06-03|accessdate=2014-06-03|publisher=Chris Lattner|quote=The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.}}</ref>
</ref> [[Potion (programming language)|potion]], [[Reia (programming language)|Reia]], [[Swift (Apple programming language)|Swift]]<ref name="lattner2014">{{Citiranje web|url=http://nondot.org/sabre/|title=Chris Lattner's Homepage|last=Lattner|first=Chris|date=2014-06-03|accessdate=2014-06-03|publisher=Chris Lattner|quote=The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.}}</ref>
|operacijski_sustav = [[Višeplatformski]]
|operacijski_sustav = [[Višeplatformski]]
|licencija = [[Ruby licenca]] ili [[BSD licenca]]<ref>[http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/COPYING?view=markup COPYING in Ruby official source repository]</ref><ref>[http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/BSDL?view=markup BSDL in Ruby official source repository]</ref>
|licencija = [[Ruby licenca]] ili [[BSD licenca]]<ref>[http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/COPYING?view=markup COPYING in Ruby official source repository]</ref><ref>[http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/BSDL?view=markup BSDL in Ruby official source repository]</ref>

Trenutačna izmjena od 00:49, 8. svibnja 2022.

  1. PREUSMJERI Predložak:Drugo značenje2
Ruby
Ruby logo.svg
Paradigma:više paradigmi: objektno orijentirani, imperativni, funkcijski, refleksivni
Pojavio se:1995.
Dizajnirao:Jukihiro Macumoto
Razvijatelj:Jukihiro Macumoto, et al.
Posljednje izdanje:2.1.2 / 9.5.2014.
Disciplina tipiziranja:dinamičko
Glavne implementacije:Ruby MRI, YARV, Rubinius, MagLev, JRuby, MacRuby, RubyMotion, HotRuby, IronRuby, Mruby
Pod utjecajem:Ada,[1] C++,[1] CLU,[2] Dylan,[2] Eiffel,[1] Lua, Lisp,[2] Perl,[2] Python,[2] Smalltalk[2]
Utjecao na:Clojure, D,[3] Elixir, Falcon, Fancy,[4] Groovy, Ioke,[5] Mirah, Nu,[6] potion, Reia, Swift[7]
OS:Višeplatformski
Licencija:Ruby licenca ili BSD licenca[8][9]
Internetska stranica:http://www.ruby-lang.org/

Ruby je dinamički, objektno orijentirani programski jezik koji kombinira sintaksu inspiriranu Perlom s nekim osobinama Smalltalka. Nastao je u Japanu 90-ih (tvorac Yukihiro Matsumoto), ali izvan Japana postaje popularniji tek u 2000.-oj s pojavom knjige na engleskom jeziku, "Programming Ruby".

Opis

Ruby je višeplatformski jezik opće namjene i otvorenog koda. Popularne primjene jezika uključuju sistemsku administraciju i izradu internetskih aplikacija, ali od 2006-e programeri polako nalaze i neke netipične primjene kao stvaranje elektroničke glazbe [10], programiranje analognog hardwarea [11] i stvaranje računalnih igara [12]. Glavna implementacija Rubya je u C-u, a druge implementacije nalazimo u Javi (JRuby), Microsoftovoj .NET platformi (IronRuby) te Objective-C (MacRuby). Zbog kvalitete implementacije MacRubyja, ona počinje biti snažna alternativa za stvaranje desktop aplikacija za Mac OS X operativni sustav.

Ruby je daleko najviše populariziran 2005.-e dolaskom Ruby on Rails frameworka za web aplikacije. Zbog toga što se u nekim zajednicama Ruby koristi gotovo isključivo za Rails programiranje, ponekad je lako protumačiti da su ta dva pojma sinonimi. To nije točno; treba razumijeti da je "Ruby on Rails" samo programska podrška napisana u Ruby programskom jeziku.

Primjeri sintakse Rubyja

Tipični "hello world" program:

 puts "Hello world!"

Stvaranje i poziv funkcije:

 def hello(name)
  puts "Hello #{name}"
 end
 
 hello("world")

Definicija klase:

 class Person
   # constructor method
   def initialize(name)
     @name = name
   end
   
   def say(text)
     puts "#{@name} says: " + text
   end
 end
 
 # usage:
 frank = Person.new("Frank")
 frank.say("Hello everyone")
 
 # output:
 # => Frank says: Hello everyone

Izvori

  1. 1,0 1,1 1,2 Cooper, Peter (2009). Beginning Ruby: From Novice to Professional. Beginning from Novice to Professional (2nd ed.). Berkeley: APress. str. 101. ISBN 1-4302-2363-4. "To a lesser extent, Python, LISP, Eiffel, Ada, and C++ have also influenced Ruby." 
  2. 2,0 2,1 2,2 2,3 2,4 2,5 Bini, Ola (2007). Practical JRuby on Rails Web 2.0 Projects: Bringing Ruby on Rails to Java. Berkeley: APress. str. 3. ISBN 1-59059-881-4. "It draws primarily on features from Perl, Smalltalk, Python, Lisp, Dylan, and CLU." 
  3. Intro – D Programming Language 1.0 – Digital Mars
  4. {{
    1. if:
    ||
    Morate navesti naslov = i url = dok rabite {{[[Predložak:Citiranje web},
    |Citiranje web},

]]}},

  • {{
    1. if:
    ||
    Morate navesti naslov = i url = dok rabite {{[[Predložak:Citiranje web},
    |Citiranje web},
  • ]]}},

  • {{
    1. if:
    ||
    Morate navesti naslov = i url = dok rabite {{[[Predložak:Citiranje web},
    |Citiranje web},

    ]]}},

  • {{
    1. if:
    ||
    Morate navesti naslov = i url = dok rabite {{[[Predložak:Citiranje web},
    |Citiranje web},

    ]]}},

  • COPYING in Ruby official source repository
  • BSDL in Ruby official source repository
  • Archaeopteryx
  • Arduino
  • Gosu
  • Vanjske poveznice