This site uses cookies.
Some of these cookies are essential to the operation of the site,
while others help to improve your experience by providing insights into how the site is being used.
For more information, please see the ProZ.com privacy policy.
This person has a SecurePRO™ card. Because this person is not a ProZ.com Plus subscriber, to view his or her SecurePRO™ card you must be a ProZ.com Business member or Plus subscriber.
Affiliations
This person is not affiliated with any business or Blue Board record at ProZ.com.
Services
Translation, Subtitling
Expertise
Specializes in:
Idioms / Maxims / Sayings
Mining & Minerals / Gems
Games / Video Games / Gaming / Casino
Computers: Software
Computers: Hardware
Computers (general)
Poetry & Literature
Also works in:
Education / Pedagogy
Computers: Systems, Networks
More
Less
Rates
English to Portuguese - Standard rate: 0.05 BRL per word / 10 BRL per hour Portuguese to English - Standard rate: 0.10 BRL per word / 12 BRL per hour
Portfolio
Sample translations submitted: 2
English to Portuguese: The End of the River
Source text - English The End of the River
Twelve generations of the Quincey family, that dogfaced line, had left their mark upon the manor. The walIs remained steadfast, but covered with a green fungus that sprouted upon the Quincey habitations, regardless of pruning. The gardener had not neglected the lawns, and the flower-beds, though pale and blowsy, were tended with all his senile care, for Chubb could never die, bound, as he was, so inextricably to the Quincey bosom. But weeds grew thick where weeds were little expected to grow. Ivy climbed up the walls of the coach house, and, in spite of the daily attentions of the youngest housemaid but one, moss invaded the front steps and rust lay thick up on the knocker. Hens upon the bird-limed patch beyond the kitchen died at a premature age, while the eggs they contrived to lay were rarely oval and often of a withered shape and a rather unpleasant mottled colour. The pigs were fed as heartily as pigs could wish, but they grew thin and died. The cows' milk tasted like vinegar.
The Quincey manor, with its portrait gallery of canine gentlemen, its dining-hall furnished in three periods, and its perilous verandahs from which the bloodless Quinceys, on midsummer nights, would pass their gravish comments on the moon, had resolved to crumble, spurning renovations and improvements, sitting on the camel hill over the disagreeable river, waiting for its end.
And Sir Peregrine, twelfth baron, had nothing but sympathy for it. It had sheltered twelve generations of doggy aristocrats and their litters, had seen small boys grow to be small men, had seen them meet, mate, and lie, at last, in the depths of the family vault, their dead paws on their chests. It had entertained near-royalty, and consequently had allotted a royal bedroom to its left wing. Over all the passions of a most impure world it had spread its painted roofs, and, on one notable occasion, had hidden, in a cellar full of stale wine and rats, the murdered body of poor Sir Thomas.
The manor, thought Sir Peregrine, was old enough to die, had pondered enough upon the human follies and felt no tear of death.
Stroking a three-days' beard, he placed a deck-chair on the safest part of the verandah, looked up into the sun and turned to the year 1889 in the Quincey Chronicles.
Somewhere a romantic daughter spelt out her Sunday music. His lady, in the quiet of her room, was writing to an Australian cousin. In his apartment the butler was reading from the literary pages of the Observer. Chubb, in the not very far distance, leaned on a garden gate and smoked.
Peregrine, read the twelfth baron from the Chronicles, took up the title on the death of his father, Belphigor, in 1889. In 1902 he married the Honourable Katerina Hautley, second daughler of Lord and Lady Winch of Alltheway Park, Glouceslershire. From this union were born three daughters: Katerina, who died of influenza in her second year, Astasia, and Phoebe Mary. Sir Peregrine was a colonel in the Territorial Army up to the Great War (1914-1918), and an official in the Ministry of War during those troubled years. He was elected Master of the Tidhampton Hunt in 1920, following upon the death of Alderman Alcock, and in 1922 broke his arm while riding with the hounds. In the following year Phoebe Mary married the Honourable Douglas Dougal, son of Sir Douglas and Lady Dougal of Halfandhalf Castle, Perth. In 1924 Phoebe Mary died in childbirth.
That was all. The Chronicles of the previous Quincey generations were written in detail and with an ornamentation of style that did credit to the literary accomplishments of the family.
But Sir Peregrine dealt in facts, and facts alone. His life until that moment, but shorn of its hopes and foolishness, its strength and weaknesses, delights and dolours, spread over half a page of the ponderous book. This little life set between the eccentricities of the longwinded Belphigor and...
Sir Peregrine put the book down. .
Chubb was still leaning and smoking. The smoke rose up vertically into the windless air. Chubb had not moved. His eyes rested on the river which went Sir Peregrine knew not where, meandering, he supposed, through a world of fields and rushes, making noise over pebbles, till it came to a sudden stop. He had always called it the one river that did not wind safely to the sea.
Astasia had stopped her playing.
Life was good, he found, on most Sunday afternoons. But to-day he was restless, and could not sit, as he had for so many years, dreamily upon the verandah, feeling the world grow and hum around him, hearing the music of a sweetly untuned piano or the songs of birds.
The day was beautiful. Clouds sailed on the sky. There was a warm sun. He looked down to where the Chronicles lay at his feet, and knew, quite suddenly and almost happily, all that was the matter. The time had come for the dissolution of the Quinceys, for the fall of their manor and the end of their dynasty.
Sir Peregrine, lifting the book, took out a pencil used to a stump through the solving of innumerable crossword puzzles.
In 1924 he read again, Phoebe Mary died in childbirth.
Phoebe Mary had been his favourite daughter. He had cried for six nights after she was buried. Then he, too, had buried her, under the clouds and mists of his mind. Once he had forgtten her name. Phoebe Mary? he said, and had fallen to wondering who that could be, with such a name.
Phoebe Mary died in childbirth.
The end of the Quinceys, he wrote with the pencil.
Then he added the date.
In the garden he looked around him, at the flowers whose colours were as even as those in a toy paint box. The little wind there was moved the petals so that they seemed, to him, to breathe for the last time the sweet air of the surrounding beds. He knew they were aware of climax, and loved them for their serenity. Chubb had nurtured them, and the end of the world would see the gardener like a god, waiting in a woman's blue smock, for his reward.
The end of the world was the end of the manor. And Chubb, though he would say nothing of it, neither affirm not contradict, had tended the first bed for the first young baron.
Sir Peregrine found him at the end of the path. The gardener did not move. His arms were resting on the gate that led to the seven fields going down to the river.
Sir Peregrine, wiping a remnant of dinner from his ancient waistcoat, looked down to where the water rolled over the dirty stones. At the end of the water was the end of everything. Today he was to walk over the fields and follow the river where it went, through towns or countries, over hills or under, until the sudden stop.
The garden was humming behind them.
The clouds moved on softly to some stop.
How old are you, Chubb? asked Sir Peregrine. You were the gardener here when Lady Astasia rode to her Queen, Ellzabeth, over the rocky roads on a piebald horse. You tended the flowers when Quentin, third of the Quinceys, wrote to his lady in an ivory tower, wrapping the verses round a pigeon's throat. At Christmas you made snowmen for me. How many years have you brooded over the dirty river? You always knew the end of all things lay where it stopped. I only knew to-day. It carne to me suddenly and I knew.
The immortal Chubb made no answer. He tilted his felt hat further back on his head, and sent up a ring of smoke from a white pipe. His face, fringed with a yellowing beard, was as round and expressionless as a saucer. At any time a breath of wind might send another crack along its surface, and make a thousand smiles or frowns. Through a space in his teeth he breathed and whistled, and made a succession of mysterious tunes as he drew at his pipe.
The exterior Chubb belied what was divine beneath. He looked like nothing more than an ancient gardener, with his woman's smock pinned untidily around him.
Chubb, I am going.
Sir Peregrine waited for the words to pierce the gardener's smoky armour.
I am going to follow the river to its end. Tell me one word of cheer before I go. Say good-bye, undying Chubb.
The birds, said the gardener, 'ave 'ad the seed_.
It was enough. Sir Peregrine climbed quickly over the gate and ran down the field. At the end was a stile. He climbed it, and ran again over the uneven grass, his hair leaping about his head and his brass-buttoned waistcoat flapping against his sides. Three fields. Four fields. Sweat ran down his forehead on to his neck and collar. He could hear his heart thundering in his ears. But he kept at the same crazy jog, over another stile, along another field, stopping to climb through a small hole in the hedge, then on again, snorting and blowing.
A crow, perched on a scarecrow's shoulder, suddenly started cawing as the twelfth baron galloped past, then flew above him, spurring him on with harsh cries.
Now he could hear the noise of the river. On the low bank above it, he stared down on to the little fishes and the shining pebbles. The crow, seeing him stop, gave a final sardonic caw, and flew back to its lone companion, who was swinging a ragged arm in the wind.
Sir Peregrine felt a great elation surging through him. He turned around, and saw the Quincey manor, on its imperial hill, squinting down upon him. He followed the river bank through the dirty fields and through a wood brown with owls' wings. He saw the sun lowering in the sky. Now he no longer ran, but stumbled over the fields, his eyes dim, covered in tears, half unseeing. His clothes were damp about him. His hair that had, in the mad run down the seven fields, leapt so proudly on his head, straggled on to his wet brow. He was thirsty and tired. But he stumbled on.
Where does the river end? he called out to an old woman driving cows over a green field. .
Where does it end? he asked. But the hedges and the ferns and the talking pebbles never replied.
He carne at last to a well by the side of a meadow, and there a girl-child was washing clothes. He saw her through his tears and heard her voice singing.
Is this the end?
Yes, said the girl-child.
The end, said Sir Peregrine in a whisper. The end of the manor, the Quinceys, and me.
The words made such a nice little rhythm that he started to sing them in his old voice.
The end of the manor, the Quinceys and me o
The child was frightened.
For twelve generations, he said, the Quinceys have lived their little lives up there. And he pointed with a bewildered hand towards the sky. This is the end, he said.
Yes, said the child.
What is the end? he said. What have you to give? What at the end?
He held his arms out.
With a frightened cry, the girl-child thrust an un-washed napkin into his hand. He clasped it, and she ran away. Not looking, but holding it to his breast and making soft, delighted noises in his throat, Sir Peregrine lay down upon the grass. The moon came up. Chubb had not failed.
And that immortal gardener, as the twelfth baron lay down on a bed of grass and soft manure, was smoking a white pipe in the quiet of the Quincey gardens. Sunday was almost passed, and then there would be another day. Contentedly the ancient gardener, in his woman's smock, leaned on the garden gate and smoked.
Translation - Portuguese O Fim do Rio
Doze gerações da família Quincey, aquela de militares, deixaram suas marcas na mansão. As paredes continuavam firmes, mas cobertas de um mofo verde que brotava no lar dos Quinceys sem ser nunca retirado. O jardineiro não havia cuidado dos gramados, e os canteiros, apesar de abatidos e bagunçados, eram cuidados com toda sua atenção senil, pois Chubb nunca poderiam morrer, ligado, como ele era, tão inseparavelmente ao seio dos Quincey. Mas ervas daninha nasciam abundantemente onde menos se esperava. Trepadeiras subiam pelas paredes da cocheira, e, apesar dos cuidados diários da criada mais jovem, musgos invadiam os degraus frontais e a ferrugem tomava conta da batedora. Galinhas jovens morriam sobre as armadilhas pela cozinha quando seus ovos eram raramente ovais, muitas vezes murchos e com uma cor bastante desagradável. Os porcos eram muito bem alimentados como todo porco desejava ser, mas cresceram magros e morreriam. O leite das vacas tinha gosto de vinagre.
A mansão dos Quincey, com sua galeria de retratos dos cavalheiros soldados, sua sala de jantar mobiliada em três sessões, e sua perigosa varanda onde os indiferentes Quinceys, nas noites em pleno verão, faziam seus sérios comentários no luar. Tinham resolvido destruí-la, rejeitando reformas e melhorias, sentados na colina do camelo acima do desagradável rio, esperando por seu fim.
E o Senhor Peregrine, décimo segundo barão, não tinha nada mais que pena disso. Ela abrigou doze gerações de cachorros aristocratas e sua ninhada, viu meninos pequenos crescerem e serem pequenos homens. Viu seus encontros, namoros, e descansos, enfim, no fundo do túmulo familiar, suas patas mortas sobre seus peitos. Havia interessado a realeza, e por causa disso tinha um quarto real separado na ala esquerda. Acima de todas as paixões de um mundo mais impuro espalhado em suas telhas pintadas, em uma excelente ocasião, foi escondido, em uma adega cheia de vinhos velhos e ratazanas, o corpo assassinado do pobre Senhor Thomas.
A mansão, pensou Senhor Peregrine, já era velho o bastante para morrer, tinha contemplado o suficiente das besteiras humanas e não sentia medo da morte.
Acariciando a barba de uns três dias, ele colocou sua espreguiçadeira na parte mais segura da varanda, olhou para o sol e voltou ao ano 1889 na história dos Quincey.
Em algum lugar uma filha romântica cantava sua música no Domingo. Sua dama, no silêncio de seu quarto, estava escrevendo para um primo Australiano. Em seu apartamento, o mordomo estava lendo as páginas literárias de o Obervador. Chubb, não muito distante dali, apoiou-se no portão do jardim e fumou.
Peregrine consagrou-se décimo segundo barão da história, assumiu o título após a morte do pai, Belphigor, em 1889. Em 1902 casou-se com a Honorável Katerina Hautley, segunda filha de Senhor e Senhora Winch do Parque Alltheway, Glouceslershire. Desta união nasceram três filhas: Katerina, que morreu de gripe com dois anos de idade, Astasia e Phoebe Mary. Senhor Peregrine foi coronel do Exército até a Primeira Guerra (1914-1918), e funcionário no Ministério de Guerra durante esses anos turbulentos. Foi eleito Mestre da Caça de Tidhampton em 1920, seguido da morte do Vereador Alcock, e em 1922 quebrou o braço enquanto caçava cavalgando. No ano seguinte Phoebe Mary casou-se com Honorável Douglas Dougal, filho de Senhor Douglas e Senhora Dougal de Castelo de Halfandhalf, Perth. Em 1924 Phoebe Mary morreu em operação de parto.
Isso era tudo. Uma História do passado da geração Quincey escrita em detalhes e com uma beleza de estilo que é motivo de orgulho aos feitios literários da família Mas Senhor Peregrine dividiu-a em fatos, e fatos isolados. A vida dele até aquele momento, cortada de suas esperanças e tolices, suas forças e fraquezas, prazeres e tristezas, espalhadas em meio à página de um tedioso livro. Esta pequena vida fixou-se entre as excentricidades do enfadonho Belphigor e...
Senhor Peregrine derrubou o livro.
Chubb ainda estava apoiado e fumando. A fumaça subiu verticalmente no ar sem vento. Chubb não havia se movido. Seus olhos miravam ao rio o qual Senhor Peregrine foi sem saber para onde, vagando, ele creu, por um mundo de campos e brejos, fazendo barulho sob as pequenas pedras, até chegar a uma súbita parada. Ele sempre o chamava de rio que não ruma com segurança para o mar.
Anastásia tinha parado sua apresentação.
A vida era boa, ele descobriu, na maioria das tardes de domingo. Mas hoje ele estava impaciente, e não pôde sentar como ele fazia durante tantos anos, sonhadoramente na varanda, sentindo o mundo cresce e cantarolar ao seu redor, ouvindo a música de um piano docemente desafinado ou o cantar dos pássaros.
O dia estava bonito. Nuvens navegavam no céu. Havia um sol quente. Ele olhou para as Histórias caídas aos seus pés, e percebeu rapidamente e com muita alegria, tudo o que era importante. O tempo chegou para a separação do Quinceys, para a queda de sua mansão e o fim de sua dinastia.
Senhor Peregrine, erguendo o livro, pegou um pedaço de lápis usado para solucionar inumeráveis palavras cruzadas.
Em 1924, ele leu novamente, Phoebe Mary morreu em operação parto.
Phoebe Mary era sua filha favorita. Ele chorou durante seis noites depois que ela foi enterrada. Então ele, também, enterrou-a, debaixo das sombras e escuridões de sua mente. Uma vez esqueceu o nome dela. Phoebe Mary? - ele disse, e perguntava a si mesmo quem poderia ser essa pessoa com tal nome.
Phoebe Mary morreu em operação parto.
O fim dos Quinceys, ele escreveu com o lápis.
Então ele datou.
No jardim ele olhou em sua volta, para as flores cujas cores eram como as de uma caixa de tinta de brinquedo. A brisa havia movido as pétalas o que parecia, para ele, respirar pela última vez o doce ar que envolvia a cama. Ele sabia que eles estavam cientes do clímax, e as amou por sua serenidade. Chubb as havia cultivado, e no fim do mundo veriam o jardineiro como um Deus, esperando com um avental azul de mulher, por sua recompensa.
O fim do mundo era o fim da mansão. E Chubb, apesar de não poder dizer nada sobre isso, nem afirmam nem negar, arrumou a primeira cama para o primeiro jovem Barão.
Senhor Peregrine encontrava-se no final do caminho. O jardineiro não se mexeu. Seus braços descansavam no portão que levava para os sete campos que iam para o rio.
Senhor Peregrine, limpando o resto de jantar do seu velho colete, olhou para onde a água rolava sobre as pedras sujas. No final da água estava o fim de tudo. Hoje ele foi caminhar ao longo dos campos e seguir aonde o rio ia, por meio a cidades ou países, sobre colinas ou por debaixo delas, até sua repentina parada.
O jardim sussurrava por trás dele.
As nuvens moviam-se suavemente com algumas pausas.
Quantos anos você tem, Chubb? - perguntou Senhor Peregrine. Você foi o jardineiro daqui quando Lady Astasia cavalgou para sua Rainha, Elizabeth, por caminhos difíceis em um cavalo malhado. Você cuidou das flores quando Quentin, terceiro dos Quinceys, escreveu para sua mulher, inspiradamente, amarrando os versos em volta da garganta de um pombo. No Natal você fez um boneco de neve para mim. Quantos anos você tem se remoído sobre este rio sujo? Você sempre soube que o final de todas as coisas estava onde ele parava. Eu soube somente hoje. Foi de repente, mas soube.
O imortal Chubb não deu resposta alguma. Curvou seu chapéu de ferro de volta à sua cabeça, e soltou um anel de fumaça do cachimbo branco. Seu rosto, envolto com uma barba amarelada, era redondo e sem expressão como um prato. A qualquer momento uma brisa poderia fazer outra rachadura em sua superfície, e fazer milhares de sorrisos ou raivas. Por um espaço em seus dentes ele respirava e assobiava, e fazia uma sucessão de misteriosos sons enquanto puxava seu cachimbo.
A aparência de Chubb escondia o que havia de divino por dentro. Ele parecia nada mais que um velho jardineiro, com seu avental de mulher preso de qualquer forma em volta dele.
Chubb, eu estou indo.
Senhor Peregrine esperou por palavras que penetrassem a armadura suja do jardineiro.
Eu vou seguir o rio até o seu fim. Diga-me uma palavra animadora antes de eu ir. Diga adeus, eterno Chubb.
Os pássaros, disse o jardineiro, ‘adeus’ siga as sementes.
Isto foi tudo. Senhor Peregrine pulou rapidamente o portão e correu pelo campo. No final tinha um lance de degraus. Ele subiu, e correu novamente pela grama irregular, seus cabelos saltavam sobre sua cabeça e seu paletó com botões de metal batia contra sua face. Três campos. Quatro campos. Suor descia sobre sua testa até seu pescoço e colarinho. Ele podia ouvir seu coração trovejando em seus ouvidos. Mas ele continuou no mesmo ritmo louco, por outro lance de degraus, ao longo de outro campo, parando para passar por um pequeno buraco na cerca viva, bufando e soprando.
Um corvo pousou no ombro de um espantalho, de repente começou a gralhar conforme o décimo segundo barão corria, então voou sobre ele, apressando-o com seus gritos cruéis.
Agora ele podia ouvir o barulho do rio. Na baixa margem acima, ele olhou abaixo os pequenos peixes e para as pedrinhas brilhantes. O corvo, vendo-o parar, deu uma última e amarga gralhada e voou de volta para seu solitário companheiro, que estava balançando um braço rasgado ao vento.
Senhor Peregirne sentiu surgir um grande entusiasmo. Virou-se, e viu a mansão Quincey, em sua colina imperial, olhando para ele ali embaixo. Ele seguiu pela margem do rio passando por campos sujos e por uma coruja da floresta com asas marrom. Ele viu o sol descendo no céu. Agora ele não corria mais, mas seguia pelos campos, seus olhos escureceram, cobertos de lágrimas, meio cego. Suas roupas estavam úmidas. Seus cabelos que tinham, na corrida maluca pelos sete campos, saltado orgulhosamente em sua cabeça, separavam-se na sua testa molhada. Ele estava com sede e cansado. Mas ele seguia.
Onde o rio termina? -gritou ele para uma velha que guiava vacas pelo campo verde.
Onde termina? -ele perguntou. Mas as cercas vivas, as samambaias e as pedras falantes nunca responderam.
Ele chegou finalmente a um poço ao lado de um pasto, e lá uma garotinha estava lavando roupas. Ele a viu através de suas lágrimas e ouviu sua voz cantando.
É este o fim?
Sim, disse garotinha.
O fim, disse Senhor Peregrine sussurrando. O fim da mansão, dos Quinceys e o meu.
As palavras fizeram um ritmo agradável que ele começou a cantá-las com sua velha voz.
O fim da mansão, dos Quinceys e o meu.
A criança estava assustada.
Por vinte gerações, ele disse, os Quinceys têm vivido suas vidinhas ali. E ele apontou confuso, com sua mão, em direção ao céu. Este é o fim, ele disse.
Sim, disse a criança.
O que é o fim? – ele disse. O que você tem a dar? O que ao final?
Ele estendeu os braços.
Com um choro assustado, a garotinha jogou um lenço sujo na mão dele. Ele agarrou, e ela fugiu. Sem olhar, mas apertando-o sobre seu peito e fazendo suaves e alegres sons em sua garganta, Senhor Peregrine deitou-se na grama. A lua apareceu. Chubb não tinha fracassado.
E o imortal jardineiro, como o décimo segundo barão, deitou-se em na cama de grama e adubo macio, estava fumando um cachimbo branco no tranqüilo jardim da mansão Quincey. O domingo estava quase acabando, e então um novo dia chegaria. Contente, o velho jardineiro, com seu avental de mulher, apoiou-se no portão do jardim e fumou.
English to Portuguese: Groovy
Source text - English 1.1.1 What is Groovy?
The Groovy web site (http://groovy.codehaus.org) gives one of the best definitions
of Groovy: “Groovy is an agile dynamic language for the Java Platform with many
features that are inspired by languages like Python, Ruby and Smalltalk, making
them available to Java developers using a Java-like syntax.”
Groovy is often referred to as a scripting language—and it works very well for
scripting. It’s a mistake to label Groovy purely in those terms, though. It can be precompiled into Java bytecode, be integrated into Java applications, power web applications, add an extra degree of control within build files, and be the basis of whole
applications on its own—Groovy is too flexible to be pigeon-holed.
What we can say about Groovy is that it is closely tied to the Java platform.
This is true in terms of both implementation (many parts of Groovy are written
in Java, with the rest being written in Groovy itself) and interaction. When you
program in Groovy, in many ways you’re writing a special kind of Java. All the
power of the Java platform—including the massive set of available libraries—is
there to be harnessed.
Does this make Groovy just a layer of syntactic sugar? Not at all. Although
everything you do in Groovy could be done in Java, it would be madness to write
the Java code required to work Groovy’s magic. Groovy performs a lot of work
behind the scenes to achieve its agility and dynamic nature. As you read this
book, try to think every so often about what would be required to mimic the
effects of Groovy using Java. Many of the Groovy features that seem extraordinary
at first—encapsulating logic in objects in a natural way, building hierarchies with
barely any code other than what is absolutely required to compute the data,
expressing database queries in the normal application language before they are
translated into SQL, manipulating the runtime behavior of individual objects
after they have been created—all of these are tasks that Java cannot perform. You
might like to think of Groovy as being a “full color” language compared with the
monochrome nature of Java—the miracle being that the color pictures are created
out of lots of carefully engineered black and white dots.
Let’s take a closer look at what makes Groovy so appealing, starting with how
Groovy and Java work hand-in-hand.
1.1.2 Playing nicely with Java: seamless integration
Being Java friendly means two things: seamless integration with the Java Runtime
Environment and having a syntax that is aligned with Java.
Seamless integration
Figure 1.2 shows the integration aspect
of Groovy: It runs inside the Java Virtual
Machine and makes use of Java’s libraries
(together called the Java Runtime
Environment or JRE). Groovy is only
a new way of creating ordinary Java
classes—from a runtime perspective,
Groovy is Java with an additional jar file
as a dependency.
Consequently, calling Java from
Groovy is a nonissue. When developing in Groovy, you end up doing this all the time without noticing.
Every Groovy type is a subtype of java.lang.Object. Every Groovy object is an instance of a type in
the normal way. A Groovy date is a java.util.Date, and so on.
Integration in the opposite direction is just as easy. Suppose a Groovy class
MyGroovyClass is compiled into a *.class file and put on the classpath. You can use
this Groovy class from within a Java class by typing
new MyGroovyClass(); // create from Java
In other words, instantiating a Groovy class is identical to instantiating a Java
class. After all, a Groovy class is a Java class. You can then call methods on the
instance, pass the reference as an argument to methods, and so forth. The JVM is
blissfully unaware that the code was written in Groovy.
Syntax alignment
The second dimension of Groovy’s friendliness is its syntax alignment. Let’s compare
the different mechanisms to obtain today’s date in Java, Groovy, and Ruby in
order to demonstrate what alignment should mean:
import java.util.*; // Java
Date today = new Date(); // Java
today = new Date() // a Groovy Script
require 'date' # Ruby
today = Date.new # Ruby
The Groovy solution is short, precise, and more compact than normal Java.
Groovy does not need to import the java.util package or specify the Date type;
moreover, Groovy doesn’t require semicolons when it can understand the code
without them. Despite being more compact, Groovy is fully comprehensible to a
Java programmer.
The Ruby solution is listed to illustrate what Groovy avoids: a different packaging
concept (require), a different comment syntax, and a different object creation
syntax. Although the Ruby way makes sense in itself (and may even be
more consistent than Java), it does not align as nicely with the Java syntax and
architecture as Groovy does.
Now you have an idea what Java friendliness means in terms of integration
and syntax alignment. But how about feature richness?
1.1.3 Power in your code: a feature-rich language
Giving a list of Groovy features is a bit like giving a list of moves a dancer can perform.
Although each feature is important in itself, it’s how well they work
together that makes Groovy shine. Groovy has three main types of features over
and above those of Java: language features, libraries specific to Groovy, and additions
to the existing Java standard classes (GDK). Figure 1.3 shows some of these
features and how they fit together. The shaded circles indicate the way that the
features use each other. For instance, many of the library features rely heavily on
language features. Idiomatic Groovy code rarely uses one feature in isolation—
instead, it usually uses several of them together, like notes in a chord.
Unfortunately, many of the features can’t be understood in just a few words.
Closures, for example, are an invaluable language concept in Groovy, but the
word on its own doesn’t tell you anything. We won’t go into all the details now,
but here are a few examples to whet your appetite.
Listing a file: closures and I/O additions
Closures are blocks of code that can be treated as first-class objects: passed
around as references, stored, executed at arbitrary times, and so on. Java’s anonymous
inner classes are often used this way, particularly with adapter classes, but
the syntax of inner classes is ugly, and they’re limited in terms of the data they can
access and change.
File handling in Groovy is made significantly easier with the addition of various
methods to classes in the java.io package. A great example is the File.
eachLine method. How often have you needed to read a file, a line at a time, and
perform the same action on each line, closing the file at the end? This is such a
common task, it shouldn’t be difficult—so in Groovy, it isn’t.
Let’s put the two features together and create a complete program that lists a
file with line numbers:
def number=0
new File ('test.groovy').eachLine { line ->
number++
println "$number: $line"
}
The closure in curly braces gets executed for each line, and File’s new eachLine
method makes this happen.
Translation - Portuguese 1.1.1 O que é Groovy?
O Groovy web site (http://groovy.codehaus.org) lhe dá uma das melhores definições do que é Groovy. “Groovy é uma linguagem ágil e dinâmica para a Plataforma Java com muitas características que são inspiradas em linguagens como Python, Ruby and Smalltalk, disponibilizando-as para criadores que utilizam uma sintaxe similar à de Java.”
Groovy é muitas vezes comparado como uma linguagem de script- e funciona muito bem para scripts. Entretanto, é um erro rotular o Groovy simplesmente nesses termos. Ele pode ser pré-compilado em bytecode Java, ser integrado em aplicativos Java, aplicativos power web, adicionando um grande grau de controle na construção de arquivos, e ser a base de todos os aplicativos. Groovy é muito flexível para ser avaliado.
O que podemos dizer sobre o Groovy é que ele está praticamente ligado à plataforma Java.
Isto é verdade em termos de conexão (muitas partes do Groovy são escritas em Java, e o resto é escrito em Groovy) e interação. Quando você programa em Groovy, muitas vezes você está escrevendo um tipo especial de Java. Todo o poder da plataforma Java- incluindo o gigantesco sistema de bibliotecas disponíveis - está lá para ser aproveitado.
Isso faz do Groovy somente um facilitador sintático? Não. Embora tudo o que você faz no Groovy possa ser feito em Java, seria loucura escrever o código necessário do Java e exigir que ele funcione como uma mágica do Groovy. O Groovy executa muitos trabalhos atrás das cenas para assegurar sua agilidade e unoiverso dinâmica. Enquanto você lê este livro, tente imaginar, de vez em quando, no que seria necessário para imitar os efeitos do Groovy usando o Java. A princípio, muitas funções do Groovy parecem extraordinárias– resumindo lógica em variáveis de um modo natural, construindo hierarquias com apenas qualquer código diferente daquele totalmente exigido para computar dados, solicitando banco de dados expressados em uma linguagem normal antes de serem traduzidas em SQL, manipulando o comportamento do tempo de duração das variáveis individuais depois de serem criadas – tudo isso são tarefas que o Java não pode executar. Você pode pensar no Groovy como uma linguagem “cheia de cor” comparada com o universo unicolor do Java - o milagre é que figuras coloridas são criadas fora dos muitos pontos pretos e brancos cuidadosamente projetados.
Vamos olhar de perto no que faz do Groovy tão atraente, começando por como Groovy e Java trabalham em conjunto.
1.1.2 Rodando bem com o Java: Integração perfeita
Ser compatível com Java significa duas coisas: integração perfeita com o Java Runtime Environment e ter uma sintaxe que é associada ao Java.
Integração Perfeita
A Figura 1.2 mostra o aspecto de integração do Groovy. Ele executa dentro do Java Virtual Machine e faz uso das bibliotecas Java (juntos chamados de Java Runtime Environment ou JRE). Groovy é somente um novo jeito de criar dados comuns do Java – de uma perspectiva de duração, o Groovy é o Java com um arquivo jar adicional como anexo.
Conseqüentemente, chamar Java de Groovy não é válido. Ao desenvolver com o Groovy, você acaba fazendo tudo isso sem perceber.
Todo tipo de Groovy é um subtipo de java.lang.Object. Cada objeto do Groovy é um exemplo de modelo no modo normal. Um dado Groovy é uma java.util.Date e assim por diante.
Integração em direções opostas é simples e fácil. Suponhamos que Groovy class MyGroovyClass seja compilado em um arquivo *.class e colocado nos classpath. Você pode usar essa Groovy class de dentro da Java class digitando new MyGroovyClass(); // create from Java
Em outras palavras, substituir alguma variável Groovy class é a mesma coisa que substituir alguma variável Java class. Portanto, Groovy class é uma Java class. Você pode então chamar método de objeto, transmitir a referência como argumento para métodos e assim sucessivamente. Felizmente o JVM não percebe que o código foi escrito em Groovy.
Alinhamento de Sintaxe
A segunda dimensão de compatibilidade do Groocy é o alinhamento de sintaxe. Vamos comparar os diferentes mecanismos para obter a data de hoje no Java, Groovy e Ruby para demonstrar qual alinhamento devemos seguir:
import java.util.*; // Java
Date today = new Date(); // Java
today = new Date() // a Groovy Script
require 'date' # Ruby
today = Date.new # Ruby
A solução com o Groovy é curta, precisa e mais compacta que a Java.
O Groovy não precisa importar o pacote java.util ou especificar o Date type; além disso, o Groovy não exige ponto e vírgula quando o código pode ser entendido sem isso. A pesar de ser mais compacto, o Groovy é totalmente acessível para um programador Java.
A solução do Ruby é listada para ilustrar o que o Groovy evita: um conceito diferente de pacote (exigido), um comentário diferente de sintaxe e uma diferente sintaxe de criação de objeto. Embora o modo do Ruby faça sentido (e possa até ser mais coerente que o Java), não alinha tão bem com a sintaxe e estrutura Java como o Groovy faz.
Agora você tem uma idéia de que significa a compatibilidade do Java em termos de integração e alinhamento de sintaxe. Mas o que você acha sobre ricas funções?
1.1.3 Poder em seu código: uma rica função de linguagem
Dar uma lista de funções do Groovy é quase o mesmo que dar uma lista de movimentos que um dançarino pode fazer.
Embora cada função seja importante por si só, o modo que elas funcionam juntas é que dá brilho ao Groovy. O Groovy tem três tipos de funções além das funções do Java: funções de linguagem, bibliotecas específicas para o Groovy, e acréscimos as classes padrões que o Java possui (GDK). A Figura 1.3 mostra algumas dessas funções e como elas combinam. Os círculos escuros indicam o modo como as funções utilizam-se uma das outras. Por exemplo, muitas funções de bibliotecas dependem muito de funções de linguagem. O código idiomático do Groovy raramente utiliza uma função separadamente – ao invés disso, utiliza várias delas juntas como as notas de um acorde.
Infelizmente, muitas das funções não podem ser entendidas em apenas algumas palavras.
Closures, por exemplo, é um conceito de linguagem indispensável no Groovy, mas a palavra em si não diz nada. Nós não vamos entrar em detalhes agora, mas aqui há alguns exemplos para abrir o seu apetite.
Listando um arquivo: closures¹ e I/O adicionais
Closures são blocos de códigos que podem ser processados como excelentes variáveis: passados um a um como referências, armazenados, às vezes executados, etc. As classes anônimas internas do Java são normalmente usadas desta maneira, particularmente com placas de expansão de classes, mas a sintaxe das classes internas é horrível, e são limitadas em termos de dados que elas podem acessar e mudar.
A manipulação de arquivos no Groovy é feita muito mais fácil com a adição de vários métodos para classes no pacote java.io. Um grande exemplo é o método File.
eachLine. Com que freqüência você precisou ler um arquivo, uma linha de cada vez, e executar a mesma ação em cada linha, fechando o arquivo no fim? Essa tarefa é bem simples, não deveria ser difícil – então, no Groovy, ela não é.
Vamos colocar duas funções juntas e criar um programa completo que registrar um arquivo com números de linha:
def number=0
new File ('test.groovy').eachLine { line ->
number++
println "$number: $line"
}
O closure em chaves é executado em cada linha, e um novo método File. eachLine é criado.
DejaVu, Dreamweaver, Frontpage, Microsoft Excel, Microsoft Word, Powerpoint, Trados Studio, Wordfast
CV/Resume
CV available upon request
Bio
Reginaldo de Carvalho Soares
Sou Pós Graduado em Tradução- Inglês/Português e graduado em Letras - Inglês/Português. Estou preparado para vencer o grande desafio que é colocar em prática meus conhecimentos.
Aguardando com grande expectativa seu retorno.