viernes, 4 de diciembre de 2015

Jolt

Jolt es un lenguaje de programación destinado a ser utilizados en cualquier lugar se podría usar C ++. Sin la carga de un legado 30 años, Jolt proporciona las características de C ++. También trata de incluir algunas de las características otros lenguajes  scripting y hasta Lisp, pero sólo de una manera que preserve fuerte tipos estáticos. Jolt toma prestado característica de los lenguajes funcionales.

Mucho bla bla, vamos un programa escrito en Jolt:

proc printf_dynamic(^const string fmt, in[] proc(char fmt) functors)
   // Prepare to parse the format string.  Let's declare some locals...
   int arg := 0             // argument index
   bool inEscape := false   // was previous char a '%'?
   string chars             // chars since last format specifier
   // A helper method for emitting the substrings around the format
   // specifiers.  If we have accumulated any characters, go and output
   // them.
   proc emitchars
      if chars.length > 0
         putstring(chars)
         chars := ""
      end
   end
   // Iterate the characters of the format string.
   for c in fmt
      if inEscape
         inEscape := false
         case c
            when "%" =>
               chars += c
            when "d", "s" =>
               emitchars
               functors[arg++](c)
            else
               raise PrintfBadFormatSpecifier()
         end
      else
         if c = "%"
            inEscape := true
         else
            chars += c
         end
      end
   end
   emitchars
end

A simple vista podemos ver que esta bueno, tiene grandes avances como pattern matching o Clausuras. vamos a tener que  seguir estudiando!!

Dejo link: http://jolt-lang.org/

No hay comentarios.:

Publicar un comentario