0% found this document useful (0 votes)
9 views44 pages

Programming With Types 1st Edition Vlad Riscutia PDF Download

The document provides links to various ebooks, including 'Programming With Types' by Vlad Riscutia and other titles related to programming, history, and social justice. It highlights Manning Publications' offerings, including early access to books and exclusive content. The content also includes a narrative about a boy named Kenneth facing challenges while navigating a leaking pile-driver on Lake Erie.

Uploaded by

manqkomaar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views44 pages

Programming With Types 1st Edition Vlad Riscutia PDF Download

The document provides links to various ebooks, including 'Programming With Types' by Vlad Riscutia and other titles related to programming, history, and social justice. It highlights Manning Publications' offerings, including early access to books and exclusive content. The content also includes a narrative about a boy named Kenneth facing challenges while navigating a leaking pile-driver on Lake Erie.

Uploaded by

manqkomaar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

Programming With Types 1st Edition Vlad Riscutia

pdf download

https://ebookmeta.com/product/programming-with-types-1st-edition-
vlad-riscutia/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Introduction to Dependent Types with Idris: Encoding


Program Proofs in Types 1st Edition Boro Sitnikovski

https://ebookmeta.com/product/introduction-to-dependent-types-
with-idris-encoding-program-proofs-in-types-1st-edition-boro-
sitnikovski-2/

Introduction to Dependent Types with Idris: Encoding


Program Proofs in Types 1st Edition Boro Sitnikovski

https://ebookmeta.com/product/introduction-to-dependent-types-
with-idris-encoding-program-proofs-in-types-1st-edition-boro-
sitnikovski/

Gentle Introduction to Dependent Types With Idris 1st


Edition Boro Sitnikovski

https://ebookmeta.com/product/gentle-introduction-to-dependent-
types-with-idris-1st-edition-boro-sitnikovski/

Colonial Authority and Tami■ Scholarship A Study of the


First English Translations 1st Edition C T Indra
(Editor)

https://ebookmeta.com/product/colonial-authority-and-
tami%e1%b8%bb-scholarship-a-study-of-the-first-english-
translations-1st-edition-c-t-indra-editor/
A Reluctant Welcome for Jewish People Voices in Le
Devoir s Editorials 1910 1947 Canadian Studies Pierre
Anctil

https://ebookmeta.com/product/a-reluctant-welcome-for-jewish-
people-voices-in-le-devoir-s-editorials-1910-1947-canadian-
studies-pierre-anctil/

National Geographic Readers Puffins Pre Reader Maya


Myers

https://ebookmeta.com/product/national-geographic-readers-
puffins-pre-reader-maya-myers/

The Polish Navy 1918 45 From the Polish Soviet War to


World War II 1st Edition Przemys■aw Budzbon Paul Wright
Illustrator

https://ebookmeta.com/product/the-polish-navy-1918-45-from-the-
polish-soviet-war-to-world-war-ii-1st-edition-przemyslaw-budzbon-
paul-wright-illustrator/

A Queerly Joyful Noise Choral Musicking for Social


Justice 1st Edition Julia "Jules" Balén

https://ebookmeta.com/product/a-queerly-joyful-noise-choral-
musicking-for-social-justice-1st-edition-julia-jules-balen/

The Struggle for Development and Democracy Volume 1 New


Approaches 1st Edition Alessandro Olsaretti

https://ebookmeta.com/product/the-struggle-for-development-and-
democracy-volume-1-new-approaches-1st-edition-alessandro-
olsaretti/
The Mayhem of Mermaids The Adventures of Smith and
Jones 2 1st Edition Marie Andreas Andreas Marie

https://ebookmeta.com/product/the-mayhem-of-mermaids-the-
adventures-of-smith-and-jones-2-1st-edition-marie-andreas-
andreas-marie/
Examples in TypeScript

Vlad Riscutia

MANNING
Save 35% at manning.com!

Use the code humble535 at checkout to save on your first purchase


at manning.com.

Manning publishes high-quality books and courses for

technology professionals. Here are a few Manning advantages: Early


access

Don’t wait to start learning! In MEAP, the Manning Early

Access Program, you read books while they’re being written.

Access anywhere with liveBook

The Manning liveBook platform provides instant browser-based


access to our content.

Beyond books

Cutting edge liveProjects, liveAudio, and liveVideo courses give you


new ways to learn. Only available at manning.com

Impeccable quality

We believe in excellence. Our customers tell us we produce the


highest quality content you can buy.

Exclusive eBooks

Manning eBooks are only available from manning.com. You won’t find
them anywhere else.

Shop now at manning.com

Register to get exclusive

offers and updates!


Types and possible values

Name [Section]

TypeScript type

Possible values

Empty type [2.1.1]

never

No possible values

Unit type [2.1.2]

void

One possible value

Sum type [3.4.2]

number | string

A value from number or a value from

string

Tuple (product type)

[number, string]

A value from number and a value from

[3.1.1]

string

Record (product
{ a: number; b: string; }

A (named) value from number and a

type) [3.1.2]

(named) value from string

Function type [5.1.2]

(value: number) => string

A function number  string

Top type [7.2.1]

unknown

A value of any type

Bottom type [7.2.2]

never

No possible values (the bottom type is the

subtype of any other type)

Interface [8.1]

interface ILogger { /* ... */ }

Object of a type that implements the

ILogger interface

Class [8.2.1]

class Square { /* ... */ }


Object of type Square

Intersection type

Square & Loggable

Object with members of both Square and

[8.4.3]

of Loggable

Generic class

class List<T> { /* ... */ }

A generic class List with a type

[9.2.1]

parameter T

Generic function

type Func<T, U> = (arg: T) => U;

A function from T  U where T and U are

[9.1.1]

type parameters

Programming

with Types

WITH EXAMPLES IN TYPESCRIPT

VLAD RISCUTIA
MANNING

SHELTER ISLAND

For online information and ordering of this and other Manning books,
please visit

www.manning.com. The publisher offers discounts on this book when


ordered in quantity.

For more information, please contact

Special Sales Department

Manning Publications Co.

20 Baldwin Road

PO Box 761

Shelter Island, NY 11964

Email: [email protected]

©2020 by Manning Publications Co. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval


system, or transmitted, in any form or by means electronic,
mechanical, photocopying, or otherwise, without prior written
permission of the publisher.

Many of the designations used by manufacturers and sellers to


distinguish their products are claimed as trademarks. Where those
designations appear in the book, and Manning Publications was
aware of a trademark claim, the designations have been printed in
initial caps or all caps.
Recognizing the importance of preserving what has been written, it is
Manning’s policy to have the books we publish printed on acid-free
paper, and we exert our best efforts to that end.

Recognizing also our responsibility to conserve the resources of our


planet, Manning books are printed on paper that is at least 15
percent recycled and processed without the use of elemental
chlorine.

Manning Publications Co.

Development editor: Elesha Hyde

20 Baldwin Road

Technical development editor: Mike Shepard

PO Box 761

Review editor: Aleksandar DragosavljevicŚhelter Island, NY 11964

Project manager: Lori Weidert

Copy editor: Kathy Simpson

Proofreader: Melody Dolab

Technical proofreader: German Gonzalez-Morris

Typesetter and cover designer: Marija Tudor

ISBN 9781617296413

Printed in the United States of America

To my wife, Diana, for her infinite patience

iv
contents

preface

xi

acknowledgments

xiii

about this book

xiv

about the cover illustration

xvii

1 Introduction to typing 1

1.1

Whom this book is for

1.2

Why types exist

0s and 1s

3 ■ What are types and type systems?

1.3
Benefits of type systems

Correctness

6 ■ Immutability

7 ■ Encapsulation

Composability

10 ■ Readability

12

1.4

Types of type systems

13

Dynamic and static typing

13 ■ Weak and strong typing

15

Type inference

16

1.5

In this book

17
2 Basic types 19

2.1

Designing functions that don’t return values

20

The empty type

20 ■ The unit type

22 ■ Exercises

23

2.2

Boolean logic and short circuits

23

Boolean expressions

24 ■ Short circuit evaluation

24

Exercise

26

vi

CONTENTS

2.3
Another Random Scribd Document
with Unrelated Content
of his boat was only secondary to the pleasure he felt in his friends’
praise.
Again luck had served them well. For the next three days a storm
raged over the lake that made the boys very thankful that they were
sheltered in a safe harbor. This tempest was a forerunner of what
was to come—a foretaste of what the young mariners were likely to
experience. The sudden storms for which the lake region was
famous at this time of year had begun, and would continue until
navigation was closed altogether by the formation of ice.
A railroad had been doing some construction work near Rondeau
Harbor, and had been making use of a few large scows, a steam
barge, and a pile-driver from Detroit. With the closing down of the
work, several of the working crew had deserted and left the captain
of the boats short handed. That was his reason, therefore, for his
request to Ransom for help.
“Lend me one of your men,” said he.
“No,” answered Kenneth. “But if my shipmates agree, I’ll help you
out, if you give us a tow to Detroit.”
“Sure; that’s easy,” the other responded heartily. All hands agreed,
and the bargain was closed there and then.
The wind had calmed down when the strange fleet started out
next afternoon. It was headed by the steam barge, then came the
top-heavy pile-driver, then a scow, and, finally, the “Gazelle” herself,
reluctantly following along, as if averse to being in such disreputable
company.
The three boys drew lots to see who should stay on the scow; the
mate was the unlucky one, but, in spite of the protests of the other
two, Kenneth insisted on filling the post himself. To his surprise, he
found that he had been assigned to the pile-driver instead of the
scow, and, though he realized that it was hardly fair dealing on the
part of the captain, it was not a time to go back on his agreement.
So he boarded the pile-driver.
“If she leaks,” the captain shouted through a megaphone to
Kenneth, “you had better get up steam in the boiler and start the
siphon going.”
The boy nodded, to indicate that he understood, and made his
way aft to the little house, where he found a small boiler, hoisting
engine and the necessary siphon.
“Jove!” he said to himself, “I am getting more than I bargained
for.”
The run to Detroit was about a hundred miles. A hundred miles in
an old tub of a pile-driver on Lake Erie in the stormy season!
Kenneth’s thoughts were not very cheerful, but he set to work to
find out all about the strange craft of which he was captain, crew,
engineer, and fireman.
Comparatively smooth when the queer procession started, after
sundown the wind began to rise, and the sea with it.
Kenneth, from his post, could see the lights on his own boat
swinging as she rolled on the waves. The towering structure that
carried the weight of the pile-driver made the craft top-heavy, and
very unwieldy in the sea. It jumped and jarred, swung from side to
side, and spanked the rollers with its blunt bow. From time to time
Kenneth sounded to see if his craft was leaking, and was comforted
to find that all was dry.
The wind increased in force, and the water rose higher each
minute with the speed characteristic of the Great Lakes. The sky was
overcast, and the darkness shut down on the rolling waters like a
black blanket. The steam barge ahead snorted away, heading into
the wind, and the old scow of a pile-driver kept its distance behind.
Kenneth felt very lonely, and longed to be aboard the “Gazelle,” the
light from whose cabin he caught fleeting glimpses of as she swung
a little to one side.
For perhaps the twentieth time, he sounded the pump, and found
this time, to his alarm, two inches of water in the shallow hold. He
waited a few minutes and tried again—three inches.
“Phew, this won’t do!” he said, half aloud. “I’ll have to start that
old siphon going.”
By the time the fire was fairly going there was four inches in the
hold, and when steam was up and the pump had begun to throw its
four-inch stream, the water had gained two inches more.
With an energy born of desperation, Kenneth piled the wood into
the furnace and kept the head of steam up. The old pump worked
well, and, for a time, held the water even. Kenneth stood in the little
house watching the steam-gauge, while the pump sucked, wheezed,
sputtered, and the thick stream gushed overboard.
Again he tested the depth of water in the hold, and found, to his
horror, that it was gaining, in spite of the steady working of the
pump. More wood went into the roaring, cavernous furnace, and the
needle of the steam-gauge pointed higher and higher; the pump
worked furiously, but still the water gained.
Kenneth went out to see if he could get help if the worst came to
the worst. The old steam-barge ahead was making heavy weather of
it, and every man on board was intent on keeping her going. Just
astern, the scow spatted the waves doggedly, her flat bows
presenting to the boy on the pile-driver a front black, forbidding, and
hopeless. Far behind, the “Gazelle” bobbed serenely over the choppy
waves.
The wind was blowing hard, and the waves raised their heads in
anger on every side, determined, it seemed to the boy alone on the
leaking boat, to have his life. He looked about for a small boat he
could resort to in case of dire need; there was none, not even a raft;
but he caught sight of a broad new board. With the deftness of long
experience, he knotted a rope about it to which he could cling, and
hauled it aft close to the cabin door, where he could jump for it in
case of need.
There was work to do inside; moreover, it was warm and light, if
lonely. Sounding again, Ransom found eight inches of water in the
hold. It was gaining slowly, and he knew that it was only a question
of time before the scow’s buoyancy would be overcome and it must
sink. Above the howling of the wind, the crackling and snapping of
the fire, the wheeze and deep-breathing sound of the pump,
Kenneth could hear the swash and gurgle of the water in the hold—a
sickening sound that weighed on his heart like lead. When the boat
rose on a wave, the water below rushed pell-mell aft and came with
a thud that jarred the whole structure against the stern; then, tilted
the other way, it rushed against the bow, until the boy thought that
the ends would be knocked out of her.
“Well, I guess my name is Dennis this time!” he said aloud. “This
old tub won’t stay on top long.” The sound of his own voice made
him more lonely than ever, as there was no response, no answering
voice to cheer and comfort him. Many trying experiences and
frequent dangers had been encountered, but seldom had he faced
peril alone. He longed for the companionship of his friends.
Kenneth sat on an old soap box and listened to the dreary sound
of the water splashing in the hold, and to the wind-devils shrieking
outside. He was utterly depressed and hopeless. As he sat with his
head in his hands, his elbows on his knees, he thought that he heard
the sound of human speech among the voices of the storm. He sat
erect, and listened with all his might.
“Ahoy, aboard the pile-driver!” the voice died away in the wind;
but again it made itself heard above the din: “Ahoy, there, Cap!”
Kenneth rushed out and forward.
A man was standing on the after-part of the barge, megaphone to
his mouth, bawling that they were going to get under the lee of
Peelee Island and lay up for the night.
With renewed courage, Kenneth went back to his stoking, and
kept the old pump going until the water-logged rolling of the crazy
craft became less violent and, finally, ceased altogether.
“Thank heaven, we are in some kind of a harbor!” said Ransom to
the man who came to relieve him. He was thankful to his heart’s
core. Coming on deck, he found that they were alongside a long pier.
He scrambled ashore and hurried aboard the “Gazelle,” weary, but
supremely happy to be alive and on his own craft again.
The skipper could hardly keep awake long enough to tell the boys
his adventures, and he had travelled far into the “Land of Nod”
before the other two turned in.
When the three arose the day was far advanced. The leak in the
pile-driver had been found and plugged, the wind had died down,
and the sea flattened out to the long, slow swell that bore no
resemblance to the tempestuous waves of the previous night. Under
smiling skies, on smooth water, the voyage to Detroit was a delight.
Many stately steamers passed them, bound to and from Lake ports.
In the early evening, the electric lights of Detroit appeared,
perched on tall, slender poles; they looked in the darkness like
clusters of stars hung in the sky.
“Michigan, My Michigan!” The boys sang in their hearts, if their lips
did not form the words. Once more they were in their native State,
and straight across to the West lay old St. Joe—so near by land, so
far by water.
The anchor down, all three boys got into “His Nibs,” eager to set
foot on dear old Michigan soil again. The little boat staggered
bravely to shore with her precious freight. Kenneth stayed, and went
back to the yacht after he had put his foot down good and hard on
Michigan land. The other two boys went on for mail and supplies.
Eager to reach home, they stayed but a day and a half at Detroit.
Under her own canvas, the “Gazelle” sailed up the Detroit River to
Lake St. Clair, then across that fine sheet of water to the St. Clair
River, the connecting link between Lakes Huron and Erie.
Frequent rain squalls had made sailing difficult and disagreeable,
but the yacht made good way, and, in spite of the uncomfortable
weather, the boys were in a very cheerful frame of mind. In Michigan
waters, off the Michigan coast, they felt that they were indeed on
the home-stretch.
As the yacht was almost entering the river, the mate pointed off
excitedly towards the flats. “What’s that?” he cried. “Look, Ken,
quick!”
A very black pillar, like thick smoke, writhed between sea and sky;
the surface of the lake rose in a cone, rose to meet it, and the sky
narrowed down like a funnel. All the time it was twisting furiously,
and the water about it was much agitated. It moved steadily across
the lake in a direction that seemed to lead to the “Gazelle.”
“Great king!” exclaimed the skipper. “That’s a waterspout, sure.
We are done for if it strikes us, just as sure as shooting!”
The comrades watched the watery column anxiously. They were
greatly relieved, at length, to see it swerve to one side, sweep
across the lake and apparently go to pieces on the further shore.
“Well, we can say, if any one asks us if we saw a waterspout, ‘Yes,
we did. Would any one else like to ask any questions?’” The mate
put on an air that imitated the cheap lyceum lecturer to the life.
Just before making Port Huron, where the St. Clair River enters
Lake Huron, the boys encountered the ugly rapids that make the
navigation of this strait so difficult. It was a mile long, and a very
trying run for a sailing vessel, even under the most favorable
circumstances. A large steamer had sunk in the channel a few weeks
before, and nearly blocked it. The wind, strong, as usual, was
blowing dead ahead. It was a beat to windward with scarcely room
to come about; one tack was hardly taken before another one had to
be made. By the time that the end of the obstructing vessel was
reached, “the crew’s” hands, so he declared, were worn through to
the bone, from the frequent and rapid handling of the jib sheet.
“Great Scott!” cried the mate from his lookout forward. “We are
running down a steamer!”
Sure enough, a great grain boat was coming in the opposite
direction, and would soon be upon them.
“It’s all right,” called out Ransom, reassuringly; “we’re clear of the
wreck now.”
The words had hardly been spoken before the wind died out, as if
by magic, and the sails flapped about limp and helpless. The great
boat had blanketed the “Gazelle” as completely as if a wall had been
built in front of her. The current was setting back toward the
abandoned steel steamship, and the yacht drifted with alarming
speed toward the obstruction.
“I’ll gybe her,” Kenneth said to himself, “and retrace our steps till
we get to the open. Then we’ll wait till there are no other boats
moving.” Aloud, he shouted: “Look out, boys! I am going to gybe.”
Just as he spoke, a blast of wind slipped by the grain boat, caught
the yacht, and slammed the boom over with terrific force. Kenneth
expected to see the masts go out of her; but everything held, and
she raced along the side of the sunken ironclad, luffed up under her
stern, and lay quivering, but safe.
The “Gazelle” sailed up the narrow passage on the starboard side
of the wreck, while the steamer passed to port. The yacht ran the
rapids successfully, and was soon speeding along over Lake Huron
with an offshore beam wind. The sixty miles to the Government
harbor of refuge at Harbor Beach, was covered at nightfall.
The next night brought them to the entrance of Saginaw Bay. So
far the winds had been favorable and the water smooth, and the
boys made daily steps sixty miles long in their journey towards
home.
They longed for home with a desire that amounted to an ache.
Neither would admit to the other how much he felt; but it was hard
sometimes to keep the tears back as something occurred to bring up
visions of the little city on the bluff.
Saginaw Bay had a bad reputation. Storms were apt to bluster
about its wide mouth, and strong winds were continually blowing
across it.
Though the low barometer indicated that bad weather was
coming, Kenneth decided that he could not wait, and he pushed on
across the treacherous bay. At night, and in a place noted for its
stormy weather, with bad weather threatening, it may have been
foolhardy to attempt the run; but the spirit that lay behind the
“Gazelle’s” motto—“Keeping everlastingly at it brings success”—
made the retracing of their steps to a safe harbor a thing dead
against the boys’ principles.
For once, the reputation of the locality seemed to be false; even
the glass appeared to be at fault, for the wind scarcely amounted to
a summer zephyr, and the waves were long and smooth.
The other boys were yawning, and at ten-thirty Kenneth sent
them below, promising to call them if need be. The skipper sat with
the tiller over his knees, thinking. There was but little to do—a
glance at the sails to see if all was drawing well, and an occasional
look out for other craft was all the attention the business in hand
required. For almost twelve long months he and his friends had lived
aboard the little craft they had learned to think of as a second home
—through strange waters, along unfamiliar shores, experiencing all
conditions of climate, and seeing all sorts of people. Dangers
innumerable had been encountered and passed safely, and now
Kenneth said to himself: “We are almost home.” The trip was well
worth while, he thought; he had gleaned information that he
believed he could not have secured any other way, and his sketch
book was full of plans of all sorts of craft he had inspected.
In almost perfect silence, surrounded by darkness, he sat thinking
and dreaming. A vision bright as a picture appeared in his mind’s
eye, and in it he saw his future career. A builder of swift steamers
and sturdy cargo boats, of sailing craft of every rig, and all was
good.
He was so wrapped up in his thoughts that for a time he did not
notice the ominous silence, the fitful, light puffs of wind that lapsed
between the calms, the sticky feeling in the air, the many signs
which bespeak a brewing storm. Not till the mainsail flapped in
answer to a change in direction of the fitful wind did the skipper
realize that trouble was coming. In an instant, the long vistas of his
pleasant dreams disappeared, and he became the sailor of a small
boat off a dangerous coast, with a storm threatening.
A puff of wind, that made the “Gazelle” quiver, came out of the
north, and Kenneth, one hand on the mainsheet, the other on the
tiller, prepared for the tussle.
In a few minutes the squall broke in earnest, and the yacht
staggered under it like a man bearing a heavy weight. She was
carrying too much canvas, so the captain called the boys. The
weather was calm and serene when they went below, and they were
mightily surprised to find the boat pitching and rolling, and the wind
tearing at the rigging as if bent on destruction.
Waking from a sound sleep and coming from a warm, bright cabin
into the outer air, where the cold wind devils held their revels, was
considerable of a shock, and both thought that it was a great deal
worse than it really was. The work of furling the mainsail was very
difficult, and did not tend to allay their fears.
“By George, Ken, we can’t last long in this!” said the mate, after
looking into the blackness and listening to the howling wind.
“Yes, I see our finish!” said the other.
“Pshaw! The ‘Gazelle’ has been through worse than this,”
answered the skipper. “See the pace she’s setting? She’s going like a
cup defender.”
But in spite of his reassuring words, Kenneth was troubled. Their
course led them through the trough of the seas, and every minute it
seemed as if the little vessel would be engulfed by the huge waves.
To turn back was impossible, to steer to one side would bring them
on a lee shore, a turn to starboard would carry them out of their
course, and far upon the open lake.
There was nothing to do but to face the situation, to be vigilant
and trust to good fortune.
Home, that seemed so near to them a short time ago, now
appeared utterly unattainable. The “Gazelle” rolled along, now
sinking deep in the watery valley, now rising high on the top of a
foam-crested hill. The motion was sickening, and continued so long
that it seemed as if they had forever been rising and falling in the
heaving billows.
Chilled to the bone, wet through from the wind-blown spray,
weary from the battle with the elements, it was like a strong hand
stretched out to a drowning man when Arthur shouted out, “Light,
ho!”
“Where away?” cried Kenneth.
“A little off the port bow. No, it’s gone!”
All three boys strained their eyes to catch a glimpse of the will-o’-
the wisp.
“There it is!”
“Where?”
“No, it’s gone!”
The wind beat the spray into their faces and snatched at their
clothing.
“There it is, sure!” Kenneth spoke exultingly. “It’s Tawas Light—at
least, it ought to be there.”
On a point of land like a crooked finger, the boys saw plainly,
when the yacht rose to the top of a wave, the steady, clear gleam of
the yellow flame.
Like a tired bird, the “Gazelle” crept inside the shelter and
anchored; her crew lowered the sails and dropped into their bunks.
Utterly exhausted, they fell asleep instantly, forgetting all troubles.
“THE ‘GAZELLE’ RACED WITH THE FLYING SPRAY INTO
PORT.”

When morning came, there was not a sign of the storm; the sky
blue and clear, a few fleecy clouds floating serenely about in it, the
Lake below gently undulating and reflecting in a deeper tone the
azure of the heavens.
With the sunshine came new confidence, and the boys laughed at
their fears of the night before.
“Let’s get under way and hurry home, for we’re only a little way
off now.” The mate was in a very jubilant frame of mind.
For several days the yacht sailed along the coast of the Lake
Huron side of the great Peninsula of Michigan—close enough to see
its beautiful shores, its rugged rocks, and dark, almost black,
evergreens.
At Presque Isle they put in for provisions. They found a beautiful
harbor, but not a sign of a settlement, and no place to buy food. The
need of provender drove them forth in spite of a storm, which an
unusually low barometer indicated was soon due. It was planned to
make harbor at Cheboygan, some sixty-five miles away, but while
passing Rogers City the yawl ran into a calm and floated idly. Great
clouds were banked up to the northeast, which spread rapidly till the
whole heavens were overcast. The water had the oily, smoky,
treacherous look that precedes a storm. Kenneth ordered in the jib
and jigger, and tied three reefs in the mainsail. No sooner had the
last knot been tied, when, with a howl that was deafening, the squall
struck them. It was a terrible blast. The “Gazelle,” being without
headway, careened before it; farther and farther she went; she sank
till her rail was on a level with the water, and it came bubbling
through the scuppers; still the pressure continued. She dipped to
leeward till her deck was covered and the waves lapped the deck
house.
“Look out, boys! Be ready to jump. She’s going over, sure!” For the
first time, Kenneth lost confidence in his boat; no craft, he thought,
could stand such a test. All hands climbed to windward, ready to
jump away from entangling rigging.
Farther and farther she listed under the fearful blast; the water
was on a line with the cabin roof now, and began to ooze through
the oval port lights into the cabin.
With muscles tense, ready to spring away, Kenneth still stood at
his post, the tiller in one hand the other clasping the cockpit rail, to
keep from sliding off into the waves.
With a thrill of hope, he felt the tug of the tiller—the indefinable
touch when a boat is in motion. The “Gazelle” was making way at
last! But still her decks sloped at the fearful angle and the squall
blew undiminished.
The mate stood close to “His Nibs,” lashed on deck, bared knife in
hand—ready to cut the ropes that bound her.
Her deck half submerged, her cockpit partly filled, the water
creeping through the ports into the cabin, the “Gazelle” surged
slowly along. The crew clung on the sloping decks, waiting for the
last sickening lurch that precedes a capsize.
CHAPTER XX

HOMEWARD BOUND

The boys did not need the captain’s cry: “Look out for yourselves,
boys; she’s going over!” to tell them that they were in fearful peril. It
had come to the time when it was every man for himself, and each
looked for a chance to escape.
But Ransom clung to the helm, and noted, with an awakening of
hope, that his boat was increasing her speed. Little by little she
gained, and inch by inch she straightened up, in spite of the knock-
down blows she got from the blast. Faster and faster she slipped
along, the energy of the wind driving her ahead, rather than over.
The water was on a line with the rail once more, and the self-bailing
valves in the cockpit began to empty it.
Arthur put his knife in his pocket and crouched down by the
windward rail, while Frank assumed a natural attitude, and began to
take a more cheerful view of things.
“Thank God!” exclaimed Kenneth, fervently. “We’re safe once
more.”
“That was the closest call we ever had,” said the mate.
It was some time before the white squall let up, and, when the
wind died down, the boys found themselves off Hammond’s Bay life-
saving station, and, thankful for the respite, they headed in for the
refuge provided by the Government.
A channel cut through the solid rock led to a little lagoon, and
through this the “Gazelle” was dragged by the good fellows of the
station.
It was well that the yacht sought this refuge, for a storm that
would have sent the staunch little craft to the bottom lasted three
days and held sway over the Lake.
The enforced stay was not irksome in the least, for there were a
great many tales to tell and to hear, and the life savers were good
fellows.
But with each day’s delay the longing for home grew stronger,
though it seemed as if the elements deliberately conspired to hold
them back.
After leaving Hammond’s Bay, they went on up the Lake Huron
coast. Storm after storm broke over them, adverse winds beset
them, and squalls dogged their wake; but at last they reached the
very tip of the Peninsula, and passed through the Straits of
Mackinac.
The feeling of exultation the sea-worn cruisers felt when the keel
of their boat once more ploughed the waters of Lake Michigan is
beyond all description. Words could not express the joy and
satisfaction they felt.
Before a high gale and a nasty sea, the “Gazelle” ran into Little
Traverse Bay—the first harbor on the western shore of Michigan.
Sailing along the coast, it seemed as if they were almost home; that
the bluffs of old St. Joe were but a little way off, and that they had
but to fire their cannon to get an answering salute from their
friends, the life-saving station men.
Putting in at Old Mission, the boys visited Kenneth’s friends several
days, while the storm king reigned outside in his royal rage and
bluster.
At every stopping place, all along the line, they received letters,
urging them to hurry, for the winter season was so close at hand,
when no man may sail on the Lakes. Their people were anxious to
have them home. The long, dangerous trip, the frequent lapses in
the correspondence (enforced, of course, but none the less hard for
the watchers at home to bear), the stories of storm and disaster at
sea, all combined to wear down the patience and courage of the
relatives at home. The long stress of violent weather at the end of a
fearfully prolonged journey, had worn on the nerves of the captain
and crew also, and they all had a bad attack of homesickness. The
longing for home when it is near at hand, but just beyond the reach,
is the hardest of all to bear.
A short spell of good weather succeeded the days of storm, and
the “Gazelle” sailed out of Old Mission for home. The boys’ friends
lined the shore and waved them “God speed,” and the three
youngsters afloat answered with a cheer, their faces bright, their
hearts aglow with anticipation. They were going Home.
The people ashore watched the little vessel, her white sides and
sails gleaming in the morning sun as she slipped off like a live thing,
dancing over the short wavelets daintily. They watched till she
disappeared behind the point.
Word was sent to St. Joseph that the “Gazelle” was on her way
again, and the people of the next port of call were on the lookout for
her.
All the newspapers of the Western coast towns had printed stories
about the three Michigan boys who had circumnavigated the Eastern
United States in their Michigan boat, and most of the inhabitants of
these towns were familiar with the story, and took pride in the
achievement.
The “Gazelle” had hardly been out of Old Mission six hours when a
storm rose that speedily developed into a hurricane. Vessels of every
kind sought harbor—steamships, schooners, whalebacks, every sort
of craft—hurried for shelter; but no word was brought of the little
yawl. She was not reported; no one had seen her since she had
sailed so jauntily out of Old Mission harbor. The papers were full of
the havoc wrought, of the shipping damaged, and lists and
estimates of the value of the property destroyed by the tempest
were published; but no mention was made of the “Gazelle”—neither
in the list of vessels lost or vessels saved did her name appear.
Frantic with anxiety, the parents of the crew sent telegrams along
the Michigan and Wisconsin coasts on both sides of the Lake, asking
for news. Then the papers began to take it up, and in large type
they printed:
“WHERE IS THE ‘GAZELLE’?”

“STILL NO NEWS OF THE MISSING YAWL.”


One stormy morning, after the newspapers had been printing
headlines like:
“‘GAZELLE’ UNDOUBTEDLY LOST,”
the lookout at Manistee life-saving station saw a small vessel, closely
reefed, scudding across the angry seas like a gull.
The lookout called to his mate: “What do you make her out to
be?” The other shielded his eyes from the sharp blasts of the spray.
“Yawl rigged, twenty-five or thirty feet, carrying jib and jigger.
Looks like she had only three men aboard—never saw her before.”
“Yawl rigged, you say?” The first life-saver stopped to look. “Thirty
feet—sure, that’s her. Do you know what that is?” He turned
excitedly to the other. “Why, that’s the ‘Gazelle.’ Been round the
United States pretty near. Papers are full of it.”
Soon the news was flashed from town to town that the “Gazelle”
was safe. The houses of gloom in St. Joseph brightened, and eyes
dimmed with tears sparkled with joy. Soon the “Gazelle” herself flew
into port and dropped anchor safe and sound.
The people of Manistee turned out to do the young sailors honor.
Again, as if by miracle, the staunch boat had triumphed over the
elements. With two anchors down, and several improvised ones out,
she had ridden the terrific gale safely.
Next day the little ship started out again, feverishly impatient to
get home. Kenneth waited only long enough for the wind to die
down a little and to get some very badly needed sleep.
With gales before them, behind them, battling with them from
every side, the dogged crew kept on, ever heading southward.
Late one day, each of the three families received a telegram that
thrilled them. “At South Haven. All well!” it read. Only twenty miles
away now!
It was over a year since the “Gazelle,” her colors flying, her
unstained sails showing white, had sailed out of St. Joseph harbor,
and yet, in spite of their eagerness to get home, in spite of the
yearning of their parents to have them home, they must needs
spend a day in fixing up. Kenneth was determined to have his vessel
look well when he entered the home port.
But, alas! with only twenty miles of the seven thousand to go, it
seemed as if they were doomed to wait yet another day. A gale was
blowing, and the rollers dashed themselves to spume against the
bulkheads protecting the harbor.
“You can’t do it,” the life-savers told the captain. “You’ll never get
between those breakwaters alive in this wind.”
“Yes, we will.” Kenneth’s mind was made up. A spirit of reckless
daring took possession of him, and he could and would get to St.
Joseph that day.
“We’ll do it, won’t we, boys?” Kenneth turned to the crew that had
never failed him.
“Sure!” was the laconic, but all-sufficient answer.
“Shake!” said the captain, and they gripped firm hands all around.
“Put in a single reef in the main,” the captain ordered, “and hoist
away.”
The boys looked at him a bit doubtfully, but obeyed without a
word. The jigger set, the anchor was hauled aboard and the jib
halliards made taut.
Slowly she began to make headway, her sails filled, and, heeling
gracefully to the wind, she headed for the narrow way between the
breakwaters.
People ashore shouted and cheered, and the boys acknowledged
the salute by waving their caps on high.
“Hurrah, for the last twenty miles!” Kenneth shouted suddenly,
then settled himself for the struggle to come.
It was a dead beat out to the open lake through the three-
hundred-foot-wide channel between the long piers. The wind blew
so hard that the spray obscured the piers from sight at times, and it
seemed impossible that any vessel propelled by sails could make
way against it.
Kenneth planned to clear the south pier with the first long tack. As
the yacht sped down towards the opening to the lake—choked as it
was with the smothering seas—he realized that he had undertaken a
very hazardous thing—realized that failure to clear the breakwater
on that tack would mean instant destruction against the bulkhead.
As they came nearer and nearer the rock-ballasted spiles, Kenneth
noticed that his boat was not pointing as high up into the wind as
usual, and that no matter how hard he jammed the helm over, she
would not head right. Instead of making the long angle that would
bring her clear of the end, the “Gazelle” was heading, in spite of all
her skipper could do, twenty feet in. The yacht acted queerly, but
was making tremendous speed. Nearer and nearer she came to the
spiles partly obscured by the spray; nearer and nearer, till the very
slap and hiss of the waves against them was heard.
The “Gazelle” was pointed straight at a group of logs some twenty
feet from the end. Kenneth was puzzled and worried, almost frantic,
indeed—never had his boat acted in this way before.
Despairingly he looked across at the rapidly narrowing strip of
foam-flecked water, when his quick eye caught a glimpse of the jib
sheet caught on the bitts.
“The jib sheet is fouled. Quick, clear it! Lively now, boys!”
In an instant it was done. The sail flew out to its rightful position,
and the “Gazelle,” like a racehorse that has been pulled in too much,
bounded forward, straight for the end of the pier. In a smother of
foam, amid a swirl of angry waters, the good yacht dashed into the
open lake, missing the end of the pier by a bare yard.
Kenneth could not hear the cheer that rose from the hundred
throats ashore, but he could feel it, and he was grateful.
A little over two hours later, the straining eyes of three boys
aboard a little yacht caught sight, through the mist and spray, of a
white tower on a high bluff, and the words “There it is!” passed from
mouth to mouth. A little later, and a fringe of people could be made
out on the top of the bluff, and some yellow-clad figures on the end
of the long breakwater, where the life-savers took their stand.
There was moisture in the boys’ eyes that could not come from
the spray, for it was salt, and a lump in their throats that would not
down.
Suddenly there was a movement among the figures on the beach,
a ripple in the long line bordering the bluff. A flash of white showed
here and there. In three places along the line bits of color waved—
red, and blue and yellow—and the eyes that watched so eagerly for
those colors, dimmed so that only a blur was left.
The yacht was sailing gallantly—speeding over the whitecaps in a
way that rejoiced her builder’s heart. The Stars and Stripes, made by
loving hands, once bright and lustrous, now dim but glorious, spread
out flat by the gale.
Nearer she came to the harbor entrance—nearer to her home
port. The faint sound of people cheering came over the seething sea
to the home-coming trio. The steadfast colors waved, and the
steadfast hearts answered each other across the water.
Kenneth headed as if to cross the harbor’s mouth. Past the long
pier the “Gazelle” flashed, and it seemed as if the boys could hear
the people groan. A little beyond, Kenneth put her helm down, and
she spun round on her heel, heading straight for the inner basin.
With sheets eased, the water boiling at her bow, the waves flowing
swiftly alongside, every stitch drawing, every fibre in the rigging
straining, the “Gazelle” raced with the flying spray into port. Her
crew, exhilarated, thankful, jubilant, could hear nothing but the
cheers of their friends, while the brave bits of color waved them a
welcome that had been waiting a long year—the best welcome of all.
THE END
*** END OF THE PROJECT GUTENBERG EBOOK A YEAR IN A YAWL
***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.

You might also like